Hi all,
I think to a "synchronisation" problem : I remember similar problem with c++ (in an other life) : The value is read before she was write. (with a Transcript, or a debug screen, the execution speed is slower.)
2006/6/29, Dave Hylands dhylands@gmail.com:
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/