soma.cell

Float equality needs a tolerance

Pitfall 6 of writing Soma, the programming language: a habit from another language, or a rule that surprises, with what the Soma compiler answers and the form to write.

return 0.1 + 0.2 == 0.3      // false — floating point
return abs((0.1 + 0.2) - 0.3) < 0.0001