Skip to content
Closed
Show file tree
Hide file tree
Changes from all 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
4 changes: 2 additions & 2 deletions Doc/library/math.rst
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,9 @@ Number-theoretic and representation functions
Return the absolute value of *x*.


.. function:: factorial(x)
.. function:: factorial(n)

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

.. deprecated:: 3.9
Expand Down
6 changes: 3 additions & 3 deletions Modules/clinic/mathmodule.c.h

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

6 changes: 3 additions & 3 deletions Modules/mathmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -2048,17 +2048,17 @@ static const unsigned long SmallFactorials[] = {
/*[clinic input]
math.factorial

x as arg: object
n as arg: object
/

Find x!.
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=6d1c8105c0d91fb4]*/
/*[clinic end generated code: output=6686f26fae00e9ca input=713fb771677e8c31]*/
{
long x, two_valuation;
int overflow;
Expand Down