summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorMatthias Görgens <matthias.goergens@gmail.com>2023-05-19 20:03:49 (GMT)
committerGitHub <noreply@github.com>2023-05-19 20:03:49 (GMT)
commit6e39fa19555043588910d10f1fe677cf6b04d77e (patch)
tree04f9df16fd8871323c195e79f2afc251c2882410 /Doc
parentc3f43bfb4bec39ff8f2c36d861a3c3a243bcb3af (diff)
downloadcpython-6e39fa19555043588910d10f1fe677cf6b04d77e.zip
cpython-6e39fa19555043588910d10f1fe677cf6b04d77e.tar.gz
cpython-6e39fa19555043588910d10f1fe677cf6b04d77e.tar.bz2
gh-94906: Support multiple steps in math.nextafter (#103881)
This PR updates `math.nextafter` to add a new `steps` argument. The behaviour is as though `math.nextafter` had been called `steps` times in succession. --------- Co-authored-by: Mark Dickinson <mdickinson@enthought.com>
Diffstat (limited to 'Doc')
-rw-r--r--Doc/library/math.rst9
1 files changed, 6 insertions, 3 deletions
diff --git a/Doc/library/math.rst b/Doc/library/math.rst
index 797f324..9e58b55 100644
--- a/Doc/library/math.rst
+++ b/Doc/library/math.rst
@@ -224,11 +224,11 @@ Number-theoretic and representation functions
of *x* and are floats.
-.. function:: nextafter(x, y)
+.. function:: nextafter(x, y, steps=1)
- Return the next floating-point value after *x* towards *y*.
+ Return the floating-point value *steps* steps after *x* towards *y*.
- If *x* is equal to *y*, return *y*.
+ If *x* is equal to *y*, return *y*, unless *steps* is zero.
Examples:
@@ -239,6 +239,9 @@ Number-theoretic and representation functions
See also :func:`math.ulp`.
+ .. versionchanged:: 3.12
+ Added the *steps* argument.
+
.. versionadded:: 3.9
.. function:: perm(n, k=None)