[RFC/RFA] Fix varobj.c value comparison problems

Paul Schlie schlie@comcast.net
Sun Feb 20 20:37:00 GMT 2005


> Mark Kettenis <kettenis@gnu.org> wrote:
>> Andrew Cagney <cagney@gnu.org> wrote:
>> Mark, the thing that's missing is an automated testcase.  Having
>> something change from -0.0 to +0.0 should do it.
>
> Ah, but that is the exact the opposite of what triggered this fix:
>
>   NaN != NaN
>
> even though the bit pattern is the same, whereas
>
>   -0.0 == +0.0

Don't know where the notion of -0.0 == +0.0 is derived from, as they
clearly express different semantics:

 1/-0.0 => -inf
 1/+0.0 => +inf

Therefore clearly aren't equivalent; although +0.0 == abs(-0.0) is.

Nor correspondingly, is it sensible that Nan != NaN; as regardless of
their indeterminate respective values, they express equivalent semantics.

Apparently, a few of the bits of wisdom brought to us by committees.





More information about the Gdb-patches mailing list