@@ -36,6 +36,21 @@ Number-theoretic and representation functions
36
36
:class: `~numbers.Integral ` value.
37
37
38
38
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
+
39
54
.. function :: copysign(x, y)
40
55
41
56
Return a float with the magnitude (absolute value) of *x * but the sign of
@@ -232,21 +247,6 @@ Number-theoretic and representation functions
232
247
:meth: `x.__trunc__() <object.__trunc__> `.
233
248
234
249
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
-
250
250
Note that :func: `frexp ` and :func: `modf ` have a different call/return pattern
251
251
than their C equivalents: they take a single argument and return a pair of
252
252
values, rather than returning their second return value through an 'output
0 commit comments