This is the mail archive of the newlib@sourceware.org mailing list for the newlib 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: strtod ("nan") returns negative NaN


On Wed, 15 Aug 2018, Paul Koning wrote:

> > * Different processors have different preferences for what a "default" 
> > quiet NaN (e.g. one produced by an operation without NaN operands) should 
> > look like.  Some clear all the lower mantissa bits, some set them.  If you 
> > use the built-in functions then you generate NaNs following GCC's 
> > knowledge of such processor conventions.
> 
> But does that matter?  It should be sufficient to generate a legal NaN 
> when one is requested.  Given that there are don't care bits in the 
> representation of NaN, it might look different from one generated by the 
> hardware as the output of some operation, but a NaN is a Nan so long as 
> it matches what the spec says -- right?

Well, it mattered enough for ARM to send a patch to the NaN bits set in 
ARM glibc fma 
<https://sourceware.org/ml/libc-alpha/2014-02/msg00740.html>.

-- 
Joseph S. Myers
joseph@codesourcery.com


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