2012/8/8 Earnie Boyd <[email protected]>:
> On Wed, Aug 8, 2012 at 11:01 AM, Kai Tietz <[email protected]> wrote:
>> 2012/8/4 Earnie Boyd <[email protected]>:
>>> I need some math whiz help.  So it seems to me that strtod("NAN",
>>> NULL) should return the same as __builtin_nan("").  And G++ should
>>> return the same result as GCC.  For the GCC instance I believe that
>>> the crt/gdtoa/strtodnrp.c code is wrong.  For the G++ instance I
>>> believe stdlib.h isn't correct.  Can someone help me debug the
>>> strtodnrp.c issue?
>>
>> Well, the issue here about strtod is, that mingw-w64 uses msvcrt's
>> variant.  So you would need to pass '1.#IND' or '1.#QNAN' (+/- NaN)
>> for your test.  If we teach gdtoa's __strtodg to handle also MS'
>> Inf/Nan syntax, then we could indeed simply override in both cases
>> msvcrt's strtod.
>>
>> So sorry, test shows expected behavior.
>
> The expected behavior for __strtod from gdtoa is to return 1.#IND0 for
> "NAN" input?  That doesn't sound correct.
>
> --
> Earnie
> -- https://sites.google.com/site/earnieboyd

Hmm, well, not necessarily.  I noticed that too.  Nevertheless if you
are using the POSIX printf function, you will see that it is actual
nan.

I will play a bit with the gdtoa's d_QNAN-constants.  Not sure if we
really need them at all.

Kai

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to