On Mon, May 18, 2015 at 11:18:59AM -0700, Carl Mäsak wrote:

> <masak> I'm fine with them being numerically equals (because they're
> the same point on the real line)

I agree with the "numerically equal", and for the reasoning, but strictly
are you using the right terms here? Specifically, are floating point numbers
"real numbers"? Or are they some sort of well specified approximation to real
numbers?

> <masak> but I'd expect === to be able to pick them apart, because ===
> is not encumbered with notions of number-ness
> <masak> now I'm going to submit this and make it look like I wrote all
> the right things from the start :P
> <TimToady> eqv and === on floaters should probably just compare chunks of 
> memory

Beware - in Perl 5 land there has been fun because if the C ABI ends up
allocating more space than the float needs (eg 80 bit IEEE floats in 12 or
16 bytes) then the C compiler isn't always consistent in what it puts in the
madding.

I think it's been biting for newer gcc (or was it g++) for some things
(probably long doubles, but I'm not certain here), and tests with pack that
were assuming bitwise perfection.

So probably it should be memory comparison on the meat, carefully avoiding
the padding.

Nicholas Clark

Reply via email to