Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ENH: Add smallest_normal and smallest_subnormal attributes to finfo (#…
…18536) * ENH: Add smallest_normal and smallest_subnormal attributes to finfo class * ENH: Add smallest_normal and smallest_subnormal attributes to MachAr * BUG: Fix minor bug in the calc of smallest_subnormal attribute * ENH: Use nextafter to calculate smallest subnormal in finfo * ENH: Use nextafter for calculating all subnormal numbers * ENH: Add warning in case the subnormal number is zero and hardcode double double value * FIX: Fix docstring in new function * FIX: Add stacklevel parameter to warning * ENH: Move smallest_subnormal to a property and add a test * FIX: Only hardcode the subnormal value for double double * FIX: Fix subnormal warning test * FIX: Fix the hardcoded value for double double type * FIX: Fix failing test by supressing an overflow warning * ENH: Fix the value for smallest_normal and tiny in double double * BUG: Fix failing tests when tiny is NaN * BUG: Fix failing test when tiny is NaN * ENH: add review fixes * ENH: Raise TypeError for smallest_subnormal/tiny value in longdouble * FIX: Replace TypeError with warning * BUG: Fix tests * ENH: Add release note * ENH: Add review changes * BUG: Fix wrong value in smallest_subnormal Co-authored-by: Sebastian Berg <sebastian@sipsolutions.net> * BUG: Fix wrong value in subnormal number * ENH: Bind the smallest_normal warning to the finfo class * BUG: Revert warning supression in tests * ENH: Add review changes * BUG: Fix failing test * BUG: Fix test identation * BUG: Fix typo * Update numpy/core/tests/test_getlimits.py Co-authored-by: Sebastian Berg <sebastian@sipsolutions.net>
- Loading branch information
Showing
9 changed files
with
249 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
Add ``smallest_normal`` and ``smallest_subnormal`` attributes to `finfo` | ||
------------------------------------------------------------------------- | ||
|
||
The attributes ``smallest_normal`` and ``smallest_subnormal`` are available as | ||
an extension of `finfo` class for any floating-point data type. To use these | ||
new attributes, write ``np.finfo(np.float64).smallest_normal`` or | ||
``np.finfo(np.float64).smallest_subnormal``. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.