Skip to content

Commit 84ddeda

Browse files
rossbarcharris
andauthored
DOC: Improve np.finfo docs (numpy#15678)
* DOC: Improve docs for np.finfo. Replace inaccurate statements about eps and epsneg attrs with correct statements and examples. Added np.spacing and np.nextafter to See Also. Closes numpy#6940. * Removed LaTeX math from finfo docstring. * MAINT: Add periods at end of some sentences. Co-authored-by: Charles Harris <[email protected]>
1 parent 917c6f1 commit 84ddeda

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

numpy/core/getlimits.py

+9-6
Original file line numberDiff line numberDiff line change
@@ -300,12 +300,13 @@ class finfo:
300300
bits : int
301301
The number of bits occupied by the type.
302302
eps : float
303-
The smallest representable positive number such that
304-
``1.0 + eps != 1.0``. Type of `eps` is an appropriate floating
305-
point type.
306-
epsneg : floating point number of the appropriate type
307-
The smallest representable positive number such that
308-
``1.0 - epsneg != 1.0``.
303+
The difference between 1.0 and the next smallest representable float
304+
larger than 1.0. For example, for 64-bit binary floats in the IEEE-754
305+
standard, ``eps = 2**-52``, approximately 2.22e-16.
306+
epsneg : float
307+
The difference between 1.0 and the next smallest representable float
308+
less than 1.0. For example, for 64-bit binary floats in the IEEE-754
309+
standard, ``epsneg = 2**-53``, approximately 1.11e-16.
309310
iexp : int
310311
The number of bits in the exponent portion of the floating point
311312
representation.
@@ -348,6 +349,8 @@ class finfo:
348349
--------
349350
MachAr : The implementation of the tests that produce this information.
350351
iinfo : The equivalent for integer data types.
352+
spacing : The distance between a value and the nearest adjacent number
353+
nextafter : The next floating point value after x1 towards x2
351354
352355
Notes
353356
-----

0 commit comments

Comments
 (0)