From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jim Blandy To: Fernando Nasser Cc: Eli Zaretskii , 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 11:38:00 -0000 Message-id: References: <3B1E5659.6950D735@redhat.com> X-SW-Source: 2001-06/msg00089.html Fernando Nasser writes: > > The only way to make sure you get the bit patterns you wanted is to > > initialize the integral members of the union with those bit patterns. > > You just want them to be different from a NaN or an Inf, because they > > cause trouble in comparisons. > > > > Am I making any sense? > > I believe there will be many failures before that happen. > > But, yes, loading the variables with known bit patterns would be immune > to that. On the other hand, what would be the bit pattern? If we use > the IEEE one it may break in systems that do not use IEEE. I think assigning a floating-point constant, which is clearly within the range of the type, is the most portable way to get a real floating-point value into the variable. The values I chose should have interesting bits throughout the mantissa, so we'll notice if they're truncated. So I still think the patch I posted is okay.