This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: <OT> newlib: pow function can produce incorrect results.


cygcary@yahoo.com wrote:
I do agree that
-1.0 to either +-infinity should be a nan, but then
using that same logic why is -1.1 to infinity and 0.9
to minus infinity equal to infinity and not nan?
Personally I don't really care which way it's done. I
just would like things to be consistent.

pow() since the very beginning treats negative integral values different from other negative values, so you can't make them totally consistent. Maybe you should stick to Fortran or BASIC.
pow(0.9, -Inf) clearly must produce Inf, same as 1/pow(0.9, Inf).
pow(-1.1, Inf) should be NaN, but again, newlib doesn't generally go beyond minimum C90 support. As newlib doesn't go very far in the direction of C99 or IEEE754 support, it is out of the realm of cygwin.


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]