This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: RFA: don't try to compare IEEE NaN's
- To: Jim Blandy <jimb at zwingli dot cygnus dot com>
- Subject: Re: RFA: don't try to compare IEEE NaN's
- From: Eli Zaretskii <eliz at is dot elta dot co dot il>
- Date: Thu, 7 Jun 2001 09:20:32 +0300 (IDT)
- cc: Jim Blandy <jimb at cygnus dot com>, gdb-patches at sources dot redhat dot com, msnyder at cygnus dot com
On 6 Jun 2001, Jim Blandy wrote:
> What you're saying is that, between this:
>
> union {
> float f;
> char bytes[80];
> } u;
>
> for (i = 0; i < 80; i++)
> u.bytes[i] = something interesting;
>
> and this:
>
> u.f = 2.7182818284590452354;
>
> that you're more concerned that the latter will put a NaN in u.f than
> the former.
Yes.
> When, in fact, the exact problem I'm trying to fix is
> that someone's first shot at the former strategy produced a NaN.
That's because the bit pattern used by the original code was a bit
pattern of a NaN in the first place. In other words, we've got
exactly what we were asking for. You cannot expect that with a
literal FP constant like the one you used.