This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
Re: [ezolt@perf.zko.dec.com] libc/1882: atof("NaN") doesn't return quiet NaN and doesn't detect IEEE mode.
- To: Andreas Jaeger <aj at suse dot de>
- Subject: Re: [ezolt@perf.zko.dec.com] libc/1882: atof("NaN") doesn't return quiet NaN and doesn't detect IEEE mode.
- From: Richard Henderson <rth at twiddle dot net>
- Date: Sat, 9 Sep 2000 12:29:14 -0700
- Cc: libc-alpha Mailinglist <libc-alpha at sourceware dot cygnus dot com>, ezolt at perf dot zko dot dec dot com
- References: <u8zolobjxc.fsf@gromit.rhein-neckar.de>
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~