Skip to content

Commit 532acbd

Browse files
mkaraevsobolevn
andauthored
[3.13] gh-133904: Fix math.factorial documentation (GH-133907) (#133922)
* [3.13] gh-133904: Fix `math.factorial` documentation (GH-133907) (cherry picked from commit 27ed645) Co-authored-by: mkaraev <[email protected]> Co-authored-by: sobolevn <[email protected]>
1 parent 8e923f3 commit 532acbd

File tree

3 files changed

+4
-9
lines changed

3 files changed

+4
-9
lines changed

Doc/library/math.rst

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,8 +144,7 @@ Number-theoretic functions
144144

145145
.. function:: factorial(n)
146146

147-
Return *n* factorial as an integer. Raises :exc:`ValueError` if *n* is not integral or
148-
is negative.
147+
Return factorial of the nonnegative integer *n*.
149148

150149
.. versionchanged:: 3.10
151150
Floats with integral values (like ``5.0``) are no longer accepted.

Modules/clinic/mathmodule.c.h

Lines changed: 2 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Modules/mathmodule.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2009,13 +2009,11 @@ math.factorial
20092009
/
20102010
20112011
Find n!.
2012-
2013-
Raise a ValueError if x is negative or non-integral.
20142012
[clinic start generated code]*/
20152013

20162014
static PyObject *
20172015
math_factorial(PyObject *module, PyObject *arg)
2018-
/*[clinic end generated code: output=6686f26fae00e9ca input=713fb771677e8c31]*/
2016+
/*[clinic end generated code: output=6686f26fae00e9ca input=366cc321df3d4773]*/
20192017
{
20202018
long x, two_valuation;
20212019
int overflow;

0 commit comments

Comments
 (0)