strtod ("nan") returns negative NaN

Steven Penny svnpenn@gmail.com
Wed Aug 15 07:36:00 GMT 2018


On Tue, 14 Aug 2018 16:44:59, Eric Blake wrote:
> The remaining question is whether it should turn "-NaN" into 
> -NaN; and the argument that glibc JUST fixed their bug 23007 to make 
> strtod("-nan") return -NaN means that Cygwin should, indeed, preserve 
> the negative sign bit when parsing "-nan".
>
> https://sourceware.org/bugzilla/show_bug.cgi?id=23007

respectfully, no, it doesnt mean that.

correct me, but Cygwin uses NewLib, not GlibC, so I would say the
"NewLib Committee" or its analog would have the say on what should happen in
this case.

Ive made my view clear already that "NaN" should never exist with a negative.
it would be equivalent to answering the question "what does blue smell like".
it just doesnt make sense.

and doing it just so that "strtod" matches "sscanf" seems like a solution going
the wrong way - we should be fixing "sscanf" to stop emitting a negative rather
than convincing "strtod" that it needs to start doing that.


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



More information about the Cygwin mailing list