[Python-ideas] Fwd: Way to check for floating point "closeness"?

Chris Barker - NOAA Federal chris.barker at noaa.gov
Mon Jan 19 03:16:02 CET 2015

> On Jan 18, 2015, at 1:02 PM, Andrew Barnert <abarnert at yahoo.com> wrote:.
> I think the right answer there is to add a float_difference that follows the same rules as the IEEE/C/POSIX nextafter function and friends. (And also maybe to add nextafter and friends--note that decimal already has similar functions, but named with underscores.) With that, it's trivial to add ulps-based tests; without it, it's very hard.
> And then ulps can be removed from the discussion on absolute and relative error.

Sounds good to me.


More information about the Python-ideas mailing list