[Python-ideas] math.nextafter

Nick Coghlan ncoghlan at gmail.com
Sat Feb 25 01:53:58 EST 2017

On 25 February 2017 at 12:43, Nathaniel Smith <njs at pobox.com> wrote:

> FWIW, numpy provides all of the following as separate functions:
> * an isclose equivalent
> * nextafter
> * a function for counting the number of ulps between two floats
> * a function for checking that two floats differ by at most N ulps

"Does NumPy offer it?" is a useful data point when asking "Is this feature
useful for numerical analysis?", so it'd helpful to know that it does have

> I'm not enough of an expert on numerical analysis to have an opinion on
> how useful these would be for Python itself. They certainly are part of a
> complete IEEE754 implementation, and useful for exploring the details of
> how floats work, if nothing else.

It seems like a reasonable thing to expose to me, rather than asking folks
to derive their own equivalents based on the information in sys.float_info.


Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20170225/db8cce1f/attachment.html>

More information about the Python-ideas mailing list