Float comparisons to 0

9
Maybe a strange question, but if you want to compare an attribut of type 'float' to 0, does it matter wether you state ' = 0 ' or ' = 0.00 '? So do I need to do (Floatattr = 0 or Floatattr = 0.00) or will only Floatattr = 0 do the trick
asked
2 answers
8

You should be careful using a '=' comparison on floats, because of the limited precision of floating point numbers. For example, the expression 1 : 3 * 3 = 1 will probably give false. Use the micro flow function floatsEqual(value1, value2, precision) instead.

answered
7

Both ways will do the trick!

answered