summaryrefslogtreecommitdiffstats
path: root/Doc/library
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2015-05-12 21:19:51 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2015-05-12 21:19:51 (GMT)
commit48e47aaa28d6dfdae128142ffcbc4b0642422e90 (patch)
treef62918798a55edb3aa09e9c95ec92d965fc5283e /Doc/library
parentf0eeedf0d8ffff9d7ea8874e60992845595f091f (diff)
downloadcpython-48e47aaa28d6dfdae128142ffcbc4b0642422e90.zip
cpython-48e47aaa28d6dfdae128142ffcbc4b0642422e90.tar.gz
cpython-48e47aaa28d6dfdae128142ffcbc4b0642422e90.tar.bz2
Issue #22486: Added the math.gcd() function. The fractions.gcd() function now is
deprecated. Based on patch by Mark Dickinson.
Diffstat (limited to 'Doc/library')
-rw-r--r--Doc/library/fractions.rst3
-rw-r--r--Doc/library/math.rst8
2 files changed, 11 insertions, 0 deletions
diff --git a/Doc/library/fractions.rst b/Doc/library/fractions.rst
index c2c7401..e0f0682 100644
--- a/Doc/library/fractions.rst
+++ b/Doc/library/fractions.rst
@@ -172,6 +172,9 @@ another rational number, or from a string.
sign as *b* if *b* is nonzero; otherwise it takes the sign of *a*. ``gcd(0,
0)`` returns ``0``.
+ .. deprecated:: 3.5
+ Use :func:`math.gcd` instead.
+
.. seealso::
diff --git a/Doc/library/math.rst b/Doc/library/math.rst
index eda0056..11389e6 100644
--- a/Doc/library/math.rst
+++ b/Doc/library/math.rst
@@ -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