New submission from John Yeung:
The math module docs state
Except when explicitly noted otherwise, all return values are floats.
But math.factorial isn't what I would call explicit about returning int:
math.factorial(x)
Return x factorial. Raises ValueError if x is not integral or is negative.
At minimum, shouldn't the first sentence be "Return x factorial as an int."? I
haven't tested on all Python versions, but math.factorial on 2.7 and 3.2
definitely return int (or long in Python 2 when necessary).
----------
assignee: docs@python
components: Documentation
messages: 255382
nosy: John.Yeung, docs@python
priority: normal
severity: normal
status: open
title: math.factorial doc should mention integer return type
versions: Python 3.5
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue25735>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com