Skip to content

Commit b7fade4

Browse files
authored
Put math.comb() docs is correct place alphabetically (GH-13734)
1 parent 6a150bc commit b7fade4

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

Doc/library/math.rst

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,21 @@ Number-theoretic and representation functions
3636
:class:`~numbers.Integral` value.
3737

3838

39+
.. function:: comb(n, k)
40+
41+
Return the number of ways to choose *k* items from *n* items without repetition
42+
and without order.
43+
44+
Also called the binomial coefficient. It is mathematically equal to the expression
45+
``n! / (k! (n - k)!)``. It is equivalent to the coefficient of the *k*-th term in the
46+
polynomial expansion of the expression ``(1 + x) ** n``.
47+
48+
Raises :exc:`TypeError` if the arguments not integers.
49+
Raises :exc:`ValueError` if the arguments are negative or if *k* > *n*.
50+
51+
.. versionadded:: 3.8
52+
53+
3954
.. function:: copysign(x, y)
4055

4156
Return a float with the magnitude (absolute value) of *x* but the sign of
@@ -232,21 +247,6 @@ Number-theoretic and representation functions
232247
:meth:`x.__trunc__() <object.__trunc__>`.
233248

234249

235-
.. function:: comb(n, k)
236-
237-
Return the number of ways to choose *k* items from *n* items without repetition
238-
and without order.
239-
240-
Also called the binomial coefficient. It is mathematically equal to the expression
241-
``n! / (k! (n - k)!)``. It is equivalent to the coefficient of the *k*-th term in the
242-
polynomial expansion of the expression ``(1 + x) ** n``.
243-
244-
Raises :exc:`TypeError` if the arguments not integers.
245-
Raises :exc:`ValueError` if the arguments are negative or if *k* > *n*.
246-
247-
.. versionadded:: 3.8
248-
249-
250250
Note that :func:`frexp` and :func:`modf` have a different call/return pattern
251251
than their C equivalents: they take a single argument and return a pair of
252252
values, rather than returning their second return value through an 'output

0 commit comments

Comments
 (0)