Avi Kivity wrote on 06/07/2005 15:38:38:
> On Tue, 2005-07-05 at 20:05 +0200, Gabriel Dos Reis wrote:
> > Paolo Carlin
> > It is definitely a good thing to use the full bits of value
> > representation if we ever want to make all "interesting" bits part of
> > the hash value. For reasonable or sane representations it suffices to
> > get your hand on the object representation, e.g.:
> >
> > const int objsize = sizeof (double);
> > typedef unsigned char objrep_t[objsize];
> > double x = ....;
> > objrep_t& p = reintepret_cast<objrep_t&>(x);
> > // ...
> >
> > and let frexp and friends only for less obvious value representation.
>
> most architectures have different bit representations for +0.0 and -0.0,
> yet the two values compare equal.
>
Yet, their sign bit is observable through things like
assert(a == 0.0);
assert(b == 0.0);
1/(1/a+ 1/b)
which would give either NaN or 0 depending on the sign
of a and b.
So do you want one or two copies in the set?