Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions Doc/library/math.rst
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,7 @@ Number-theoretic functions

.. function:: factorial(n)

Return *n* factorial as an integer. Raises :exc:`ValueError` if *n* is not integral or
is negative.
Return *n* factorial as an integer.

.. versionchanged:: 3.10
Floats with integral values (like ``5.0``) are no longer accepted.
Expand Down
6 changes: 2 additions & 4 deletions Modules/clinic/mathmodule.c.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions Modules/mathmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -2009,12 +2009,11 @@ math.factorial

Find n!.

Raise a ValueError if x is negative or non-integral.
[clinic start generated code]*/

static PyObject *
math_factorial(PyObject *module, PyObject *arg)
/*[clinic end generated code: output=6686f26fae00e9ca input=713fb771677e8c31]*/
/*[clinic end generated code: output=6686f26fae00e9ca input=06200bf38384f7ae]*/
{
long x, two_valuation;
int overflow;
Expand Down
Loading