From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michael Snyder To: Eli Zaretskii Cc: Jim Blandy , gdb-patches@sources.redhat.com Subject: Re: RFA: don't try to compare IEEE NaN's Date: Thu, 07 Jun 2001 10:38:00 -0000 Message-id: <3B1FBC02.2865152D@cygnus.com> References: X-SW-Source: 2001-06/msg00137.html 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