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



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.


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