This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


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

Re: RFA: don't try to compare IEEE NaN's



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.


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