This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


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

Re: [ezolt@perf.zko.dec.com] libc/1882: atof("NaN") doesn't return quiet NaN and doesn't detect IEEE mode.


On Mon, Sep 04, 2000 at 11:11:59AM +0200, Andreas Jaeger wrote:
> When compiling with -ieee (with both Gcc & ccc), perl works just fine.
> Without -ieee & -mieee, there is a floating point exception.  This
> appears to depend on the value that atof (& strtod) returns when passed
> a "NaN". 

What do you expect, anyway?  I expect exactly this result.

> 1) GNU Libc's atof (and strtod) is not returning a quiet NaN.

Yes it is.  But without -mieee, even a quiet nan results in SIGFPE.

> It would also be nice if the Alpha Linux libc figured out the
> -mieee setting of its callers.  There is no standard requiring this
> but we should suggest the behavior to the Alpha Linux libc maintainers.

Yes, that would be nice, I suppose.  You'll want to play silly games with 

#ifndef _IEEE_FP
double atof(const char *) __asm__("__noieee_atof");
#else
double atof(const char *);
#endif

Patches accepted.



r~

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