Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 54cfbb2

Browse files
authored
bpo-39288: Add examples to math.nextafter() documentation (GH-17962)
1 parent 0ca7cc7 commit 54cfbb2

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

Doc/library/math.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,13 @@ Number-theoretic and representation functions
219219

220220
If *x* is equal to *y*, return *y*.
221221

222+
Examples:
223+
224+
* ``math.nextafter(x, math.inf)`` goes up: towards positive infinity.
225+
* ``math.nextafter(x, -math.inf)`` goes down: towards minus infinity.
226+
* ``math.nextafter(x, 0.0)`` goes towards zero.
227+
* ``math.nextafter(x, math.copysign(math.inf, x))`` goes away from zero.
228+
222229
.. versionadded:: 3.9
223230

224231
.. function:: perm(n, k=None)

0 commit comments

Comments
 (0)