mirror of
https://github.com/python/cpython.git
synced 2025-09-28 03:13:48 +00:00
Put math.comb() docs is correct place alphabetically (GH-13734)
This commit is contained in:
parent
6a150bcaeb
commit
b7fade4f87
1 changed files with 15 additions and 15 deletions
|
@ -36,6 +36,21 @@ Number-theoretic and representation functions
|
||||||
:class:`~numbers.Integral` value.
|
:class:`~numbers.Integral` value.
|
||||||
|
|
||||||
|
|
||||||
|
.. function:: comb(n, k)
|
||||||
|
|
||||||
|
Return the number of ways to choose *k* items from *n* items without repetition
|
||||||
|
and without order.
|
||||||
|
|
||||||
|
Also called the binomial coefficient. It is mathematically equal to the expression
|
||||||
|
``n! / (k! (n - k)!)``. It is equivalent to the coefficient of the *k*-th term in the
|
||||||
|
polynomial expansion of the expression ``(1 + x) ** n``.
|
||||||
|
|
||||||
|
Raises :exc:`TypeError` if the arguments not integers.
|
||||||
|
Raises :exc:`ValueError` if the arguments are negative or if *k* > *n*.
|
||||||
|
|
||||||
|
.. versionadded:: 3.8
|
||||||
|
|
||||||
|
|
||||||
.. function:: copysign(x, y)
|
.. function:: copysign(x, y)
|
||||||
|
|
||||||
Return a float with the magnitude (absolute value) of *x* but the sign of
|
Return a float with the magnitude (absolute value) of *x* but the sign of
|
||||||
|
@ -232,21 +247,6 @@ Number-theoretic and representation functions
|
||||||
:meth:`x.__trunc__() <object.__trunc__>`.
|
:meth:`x.__trunc__() <object.__trunc__>`.
|
||||||
|
|
||||||
|
|
||||||
.. function:: comb(n, k)
|
|
||||||
|
|
||||||
Return the number of ways to choose *k* items from *n* items without repetition
|
|
||||||
and without order.
|
|
||||||
|
|
||||||
Also called the binomial coefficient. It is mathematically equal to the expression
|
|
||||||
``n! / (k! (n - k)!)``. It is equivalent to the coefficient of the *k*-th term in the
|
|
||||||
polynomial expansion of the expression ``(1 + x) ** n``.
|
|
||||||
|
|
||||||
Raises :exc:`TypeError` if the arguments not integers.
|
|
||||||
Raises :exc:`ValueError` if the arguments are negative or if *k* > *n*.
|
|
||||||
|
|
||||||
.. versionadded:: 3.8
|
|
||||||
|
|
||||||
|
|
||||||
Note that :func:`frexp` and :func:`modf` have a different call/return pattern
|
Note that :func:`frexp` and :func:`modf` have a different call/return pattern
|
||||||
than their C equivalents: they take a single argument and return a pair of
|
than their C equivalents: they take a single argument and return a pair of
|
||||||
values, rather than returning their second return value through an 'output
|
values, rather than returning their second return value through an 'output
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue