newlib: pow function can produce incorrect results.
Thu Apr 19 02:50:00 GMT 2007
I'm not certain if this is a newlib compilation flag
problem, something that has been fixed in the 1.15
version of newlib or just that newlib does things
differently. Looking at the 1.15 code implies that
some of these should work and the rest appear to be a
deviation from other systems. I tested this on my RH
Linux enterprise 3 machine and got the expected
results for everything. My cygwin is up to date.
First the ones that the 1.15 code says should work
correctly: pow(1.0, nan) and pow(nan, 0.0) both should
return 1.0. I'm currently getting nan for both of
The other ones are pow(1.0, inf), pow(-1.0, inf),
pow(1.0, -inf) and pow(-1.0, -inf) which I believe
should all return 1.0 as well. They are also returning
nan. What's interesting about these are that if you
it describes exactly how to handle every case of x ^
inf except for the case of positive 1. Maybe they are
assuming we all remember that 1 raised to any power is
The later ones may not belong here, but whoever is
maintaining newlib for cygwin likely has a stronger
voice with the newlib developers than I would have so
I thought I would include them as well.
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
More information about the Cygwin