]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Change parameter name from *x* for reals to *n* for integers. (GH-32377)
authorRaymond Hettinger <rhettinger@users.noreply.github.com>
Wed, 6 Apr 2022 19:35:05 +0000 (14:35 -0500)
committerGitHub <noreply@github.com>
Wed, 6 Apr 2022 19:35:05 +0000 (14:35 -0500)
Doc/library/math.rst
Modules/clinic/mathmodule.c.h
Modules/mathmodule.c

index 48030fae189ba620b1f7e4b2789888d1fafe52a8..5efcc7f6a6efc4dfde01ef177936871e61daa83f 100644 (file)
@@ -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
index 65f3dd4f520aeb172e454402cf7bf3e5239fe341..4ea0bb82b8e2c805e8b555b02c47ab8f67b80011 100644 (file)
@@ -45,10 +45,10 @@ PyDoc_STRVAR(math_isqrt__doc__,
     {"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.");
 
@@ -865,4 +865,4 @@ math_ulp(PyObject *module, PyObject *arg)
 exit:
     return return_value;
 }
-/*[clinic end generated code: output=1eae2b3ef19568fa input=a9049054013a1b77]*/
+/*[clinic end generated code: output=6381e7d982ff3711 input=a9049054013a1b77]*/
index f0aaf23845f6db25a577b9d66bd3ef89780977d5..8dd763f2720eec436bb8e06963c55f198b25744c 100644 (file)
@@ -2093,17 +2093,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;