diff options
author | Ross Barnowski <rossbar@berkeley.edu> | 2020-03-01 20:00:16 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-01 21:00:16 -0700 |
commit | 84ddedadaee13fe22cc36a0c67c3cb73e818ee9f (patch) | |
tree | 8af5c147f5c5cb6f0af67ac329a332a1dcd58355 /numpy/core/getlimits.py | |
parent | 917c6f18ba6691bd29e7e103b65dff75af735faf (diff) | |
download | numpy-84ddedadaee13fe22cc36a0c67c3cb73e818ee9f.tar.gz |
DOC: Improve np.finfo docs (#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 #6940.
* Removed LaTeX math from finfo docstring.
* MAINT: Add periods at end of some sentences.
Co-authored-by: Charles Harris <charlesr.harris@gmail.com>
Diffstat (limited to 'numpy/core/getlimits.py')
-rw-r--r-- | numpy/core/getlimits.py | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/numpy/core/getlimits.py b/numpy/core/getlimits.py index b00ef64bd..e2ff49393 100644 --- a/numpy/core/getlimits.py +++ b/numpy/core/getlimits.py @@ -300,12 +300,13 @@ class finfo: bits : int The number of bits occupied by the type. eps : float - The smallest representable positive number such that - ``1.0 + eps != 1.0``. Type of `eps` is an appropriate floating - point type. - epsneg : floating point number of the appropriate type - The smallest representable positive number such that - ``1.0 - epsneg != 1.0``. + The difference between 1.0 and the next smallest representable float + larger than 1.0. For example, for 64-bit binary floats in the IEEE-754 + standard, ``eps = 2**-52``, approximately 2.22e-16. + epsneg : float + The difference between 1.0 and the next smallest representable float + less than 1.0. For example, for 64-bit binary floats in the IEEE-754 + standard, ``epsneg = 2**-53``, approximately 1.11e-16. iexp : int The number of bits in the exponent portion of the floating point representation. @@ -348,6 +349,8 @@ class finfo: -------- MachAr : The implementation of the tests that produce this information. iinfo : The equivalent for integer data types. + spacing : The distance between a value and the nearest adjacent number + nextafter : The next floating point value after x1 towards x2 Notes ----- |