summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorananthan-123 <ananthakrishnan15.2001@gmail.com>2020-02-19 18:21:37 (GMT)
committerGitHub <noreply@github.com>2020-02-19 18:21:37 (GMT)
commitf2ee21d858bc03dd801b97afe60ee2ea289e2fe9 (patch)
tree7a35d8b02a53df4505d275b67bc56462cda33619 /Doc
parent4dee92b0ad9f4e3ea2fbbbb5253340801bb92dc7 (diff)
downloadcpython-f2ee21d858bc03dd801b97afe60ee2ea289e2fe9.zip
cpython-f2ee21d858bc03dd801b97afe60ee2ea289e2fe9.tar.gz
cpython-f2ee21d858bc03dd801b97afe60ee2ea289e2fe9.tar.bz2
bpo-39479:Add math.lcm() function: Least Common Multiple (#18547)
* Update math.rst * Update math.rst * updated whats new * Update test_math.py * Update mathmodule.c * Update mathmodule.c.h * Update ACKS * 📜🤖 Added by blurb_it. * Update 3.9.rst * Update 2020-02-18-12-37-16.bpo-39479.j3UcCq.rst * Update math.rst * Update 2020-02-18-12-37-16.bpo-39479.j3UcCq.rst * Update test_math.py * Update ACKS * Update mathmodule.c.h * Update mathmodule.c * Update mathmodule.c.h * Update mathmodule.c.h Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Diffstat (limited to 'Doc')
-rw-r--r--Doc/library/math.rst9
-rw-r--r--Doc/whatsnew/3.9.rst3
2 files changed, 12 insertions, 0 deletions
diff --git a/Doc/library/math.rst b/Doc/library/math.rst
index c4c1800..d8ac352 100644
--- a/Doc/library/math.rst
+++ b/Doc/library/math.rst
@@ -136,6 +136,15 @@ Number-theoretic and representation functions
.. versionadded:: 3.5
+.. function:: lcm(a, b)
+
+ Return the least common multiple of integers *a* and *b*. The value of
+ ``lcm(a, b)`` is the smallest nonnegative integer that is a multiple of
+ both *a* and *b*. If either *a* or *b* is zero then ``lcm(a, b)`` is zero.
+
+ .. versionadded:: 3.9
+
+
.. function:: isclose(a, b, *, rel_tol=1e-09, abs_tol=0.0)
Return ``True`` if the values *a* and *b* are close to each other and
diff --git a/Doc/whatsnew/3.9.rst b/Doc/whatsnew/3.9.rst
index 66eb9e7..161675d 100644
--- a/Doc/whatsnew/3.9.rst
+++ b/Doc/whatsnew/3.9.rst
@@ -216,6 +216,9 @@ import attempts.
math
----
+Add :func:`math.lcm`: return the least common multiple of *a* and *b*.
+(Contributed by Ananthakrishnan in :issue:`39479`.)
+
Add :func:`math.nextafter`: return the next floating-point value after *x*
towards *y*.
(Contributed by Victor Stinner in :issue:`39288`.)