public documents 6
public documents 6
math.comb(n, k)
Return the number of ways to choose k items from n items without repetition
and without order.
math.factorial(n)
Changed in version 3.10: Floats with integral values (like 5.0) are no longer
accepted.
math.gcd(*integers)
Return the greatest common divisor of the specified integer arguments. If any of
the arguments is nonzero, then the returned value is the largest positive integer
that is a divisor of all arguments. If all arguments are zero, then the returned
value is 0. gcd() without arguments returns 0.
math.isqrt(n)
Return the integer square root of the nonnegative integer n. This is the floor of
the exact square root of n, or equivalently the greatest integer a such that a² ≤ n.
For some applications, it may be more convenient to have the least
integer a such that n ≤ a², or in other words the ceiling of the exact square root
of n. For positive n, this can be computed using a = 1 + isqrt(n - 1).