[Python-ideas] math.nextafter
Nick Coghlan
ncoghlan at gmail.com
Fri Feb 24 04:13:56 EST 2017
On 6 February 2017 at 20:29, M.-A. Lemburg <mal at egenix.com> wrote:
> On 04.02.2017 12:59, Stephan Houben wrote:
> > Hi all,
> >
> > Visual C++ 2015 supports this one:
> >
> > https://msdn.microsoft.com/en-us/library/h0dff77w.aspx
> >
> > In any case, this is easy to implement an efficient fallback in C, unlike
> > the fma() function we discussed some time ago.
> >
> > To put this in a bit wider perspective: would it be useful to investigate
> > how much of the C99 math library could
> > be supported in Python in general?
>
> +1 from me for those features which can be emulated for
> platforms which don't have the math lib function
> available and are not too esoteric (though many of those
> have already been added), e.g. cbt() may be useful.
>
> Now, with respect to the one mentioned in the subject,
> I'm not sure how useful this would be in the stdlib,
> since it's very much tied to whatever float type Python
> happens to use on a platform.
>
Just from an API point of view, a more idiomatically-Pythonic concept seems
to me to be a "floatrange()" construct, where the default step was defined
by the internal representation (i.e. it would increment by the smallest
possible value).
I'm not sure of any use cases outside exploring the behaviour of numerical
algorithm implementations in the presence of mathematical discontinuities,
though.
Cheers,
Nick.
--
Nick Coghlan | ncoghlan at gmail.com | Brisbane, Australia
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20170224/b032cb7c/attachment.html>
More information about the Python-ideas
mailing list