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: Fernando Nasser <fnasser at redhat dot com>
- Subject: Re: RFA: don't try to compare IEEE NaN's
- From: Jim Blandy <jimb at zwingli dot cygnus dot com>
- Date: 06 Jun 2001 13:39:59 -0500
- Cc: Eli Zaretskii <eliz at is dot elta dot co dot il>, Jim Blandy <jimb at cygnus dot com>,gdb-patches at sources dot redhat dot com, msnyder at cygnus dot com
- References: <Pine.SUN.3.91.1010606184023.18730A-100000@is><3B1E5659.6950D735@redhat.com>
Fernando Nasser <fnasser@redhat.com> 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.