BUG FFI/unix vm ? Hackers help requested !

Dave Hylands dhylands at gmail.com
Thu Jun 29 14:50:06 UTC 2006


Hi Nicolas,

> And on the seventh call, i always get a stange result (result is 0.0 but will
> answer false to = 0.0).

I don't know a whole lot about FFI, but I know that generally accepted
practice (at least in C which is the language I'm most familiar with)
is that you NEVER test for equality when using floating point numbers.

You always use some small epsilon and test that the number you've got
is within epsilon of the comparison number.

This is because due to roundoff and other such effects, you can wind
up with really tiny numbers, like 1 x 10^-53 which is essentially
zero, but is not equal to zero.

This might not even be relevant to your discussion, but seeing the
equality test on 0.0 raised a red flag for me.

-- 
Dave Hylands
Vancouver, BC, Canada
http://www.DaveHylands.com/



More information about the Squeak-dev mailing list