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: Eli Zaretskii <eliz at is dot elta dot co dot il>
- Subject: Re: RFA: don't try to compare IEEE NaN's
- From: Michael Snyder <msnyder at cygnus dot com>
- Date: Thu, 07 Jun 2001 10:38:10 -0700
- CC: Jim Blandy <jimb at cygnus dot com>, gdb-patches at sources dot redhat dot com
- Organization: Red Hat
- References: <Pine.SUN.3.91.1010607091954.28343B-100000@is>
Eli Zaretskii wrote:
>
> 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.
I was not specifically trying to create a NaN --
just a recognizeable bit pattern.
Michael