From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eli Zaretskii To: Jim Blandy Cc: Jim Blandy , gdb-patches@sources.redhat.com, msnyder@cygnus.com Subject: Re: RFA: don't try to compare IEEE NaN's Date: Wed, 06 Jun 2001 23:19:00 -0000 Message-id: References: X-SW-Source: 2001-06/msg00108.html 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.