[docs] [issue25735] math.factorial doc should mention integer return type

John Yeung report at bugs.python.org
Wed Nov 25 14:44:31 EST 2015


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 at python
components: Documentation
messages: 255382
nosy: John.Yeung, docs at python
priority: normal
severity: normal
status: open
title: math.factorial doc should mention integer return type
versions: Python 3.5

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue25735>
_______________________________________


More information about the docs mailing list