summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2020-01-12 12:57:47 +0100
committerGitHub <noreply@github.com>2020-01-12 12:57:47 +0100
commit54cfbb2feee1f7328c3d6799ec3734b00824b555 (patch)
treeb395682d2731865f05ea90fcd39ff110f18daf7c
parent0ca7cc7fc0518c24dc9b78c38418e6064e64f148 (diff)
downloadcpython-git-54cfbb2feee1f7328c3d6799ec3734b00824b555.tar.gz
bpo-39288: Add examples to math.nextafter() documentation (GH-17962)
-rw-r--r--Doc/library/math.rst7
1 files changed, 7 insertions, 0 deletions
diff --git a/Doc/library/math.rst b/Doc/library/math.rst
index 135adf8f63..c9f2a38331 100644
--- a/Doc/library/math.rst
+++ b/Doc/library/math.rst
@@ -219,6 +219,13 @@ Number-theoretic and representation functions
If *x* is equal to *y*, return *y*.
+ Examples:
+
+ * ``math.nextafter(x, math.inf)`` goes up: towards positive infinity.
+ * ``math.nextafter(x, -math.inf)`` goes down: towards minus infinity.
+ * ``math.nextafter(x, 0.0)`` goes towards zero.
+ * ``math.nextafter(x, math.copysign(math.inf, x))`` goes away from zero.
+
.. versionadded:: 3.9
.. function:: perm(n, k=None)