buggy behavior on conditional?

mbira's picture

I have a conditional that is modulating between three values. The first value is 0.007874

I set condition to "equal"

I set second value to 0.007874

And yet the result never goes true.

Why is that?

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

smokris's picture
Re: buggy behavior on conditional?

Floating point math is not exact.

Read http://www.cygnus-software.com/papers/comparingfloats/Comparing%20floati... .

Give your Conditional a nonzero Tolerance (perhaps 0.000001 for the example you mentioned above).

mbira's picture
Re: buggy behavior on conditional?

Great! Thank you!