Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
fix math.factorial documentation
  • Loading branch information
mkaraev committed May 12, 2025
commit b332cb66439c6c8053c69407d721300b5cd28f19
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:`TypeError` if *n* is not integral or
is negative.
Return *n* factorial as an integer.
Comment thread
skirpichev marked this conversation as resolved.
Outdated

.. 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!.

Comment thread
skirpichev marked this conversation as resolved.
Outdated
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