Skip to content

Commit 27ed645

Browse files
mkaraevsobolevn
andauthored
gh-133904: Fix math.factorial documentation (#133907)
Co-authored-by: sobolevn <[email protected]>
1 parent c2989b7 commit 27ed645

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
@@ -2008,13 +2008,11 @@ math.factorial
20082008
/
20092009
20102010
Find n!.
2011-
2012-
Raise a ValueError if x is negative or non-integral.
20132011
[clinic start generated code]*/
20142012

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

0 commit comments

Comments
 (0)