From: Victor Stinner Date: Sun, 12 Jan 2020 11:57:47 +0000 (+0100) Subject: bpo-39288: Add examples to math.nextafter() documentation (GH-17962) X-Git-Tag: v3.9.0a3~94 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=54cfbb2feee1f7328c3d6799ec3734b00824b555;p=thirdparty%2FPython%2Fcpython.git bpo-39288: Add examples to math.nextafter() documentation (GH-17962) --- diff --git a/Doc/library/math.rst b/Doc/library/math.rst index 135adf8f6362..c9f2a383312f 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)