mirror of
https://github.com/python/cpython.git
synced 2025-08-03 08:34:29 +00:00
Issue #22486: Added the math.gcd() function. The fractions.gcd() function now is
deprecated. Based on patch by Mark Dickinson.
This commit is contained in:
parent
f0eeedf0d8
commit
48e47aaa28
9 changed files with 342 additions and 13 deletions
|
@ -100,6 +100,14 @@ Number-theoretic and representation functions
|
|||
<http://code.activestate.com/recipes/393090/>`_\.
|
||||
|
||||
|
||||
.. function:: gcd(a, b)
|
||||
|
||||
Return the greatest common divisor of the integers *a* and *b*. If either
|
||||
*a* or *b* is nonzero, then the value of ``gcd(a, b)`` is the largest
|
||||
positive integer that divides both *a* and *b*. ``gcd(0, 0)`` returns
|
||||
``0``.
|
||||
|
||||
|
||||
.. function:: isfinite(x)
|
||||
|
||||
Return ``True`` if *x* is neither an infinity nor a NaN, and
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue