Re: make check errors on linux



Michael Meeks <michael helixcode com> writes:

> > Comparing floats with == is a dumb mistake :-)
> 
> 	Well; you seem to be right, however no manipulaton is done on the
> floats, they are simply copied from a to b and then compared. ie if:
> 
> 	double a = 3.5, b;
> 	b = a;
> 	g_assert (a == b);
> 
> 	fails; then something strange is happening.

x86 has 80-bit floating point registers, or somesuch?  If one of
these gets into a register and the other's in RAM, what's the betting
that they'll compare unequal?

> Worse still when the
> chap adds the fprintf then the compare succeeds.

That could quite easily shuffle the register allocator around (as in,
a function call will cause everything to get spilled)

Disclaimer: I have no idea if this is what's happening, but I
wouldn't trust it not to be.


> > Comparing floats with == is a dumb mistake :-)

-dan

-- 

  http://ww.telent.net/cliki/ - Link farm for free CL-on-Unix resources 




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]