bpo-39288: Add examples to math.nextafter() documentation (GH-17962)

This commit is contained in:
Victor Stinner 2020-01-12 12:57:47 +01:00 committed by GitHub
parent 0ca7cc7fc0
commit 54cfbb2fee
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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)