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
{"isqrt", (PyCFunction)math_isqrt, METH_O, math_isqrt__doc__},
PyDoc_STRVAR(math_factorial__doc__,
-"factorial($module, x, /)\n"
+"factorial($module, n, /)\n"
"--\n"
"\n"
-"Find x!.\n"
+"Find n!.\n"
"\n"
"Raise a ValueError if x is negative or non-integral.");
exit:
return return_value;
}
-/*[clinic end generated code: output=1eae2b3ef19568fa input=a9049054013a1b77]*/
+/*[clinic end generated code: output=6381e7d982ff3711 input=a9049054013a1b77]*/
/*[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;