> > Um, I don't think it's right to *always* do the comparison
> > floating point.  Specifically, if both operands are ints,
> > the comparison should be int.
>
> I thought about this, but all it buys you is a few bits of precision when
> your ints and floats are both 64-bit, and slower comparisons all the time.
> IMHO it's a wash, so I did it this way.

If A = 2^30 and B = 2^30+1, won't they be the identical value when
converted to IEEE floats on a 32-bit platform? IEEE floats have a 23 bit
mantissa, which isn't enough to differentiate between 1^30 and 1^30+1^0,
since 30 - 0 > 23.

Am I missing something here?

Thanks,
Mike Lambert


Reply via email to