Forum Discussion
is this a bug or a feature? - adding values, result is wrong when last reference is 0
- Aug 25, 2022
It is just a fact of life that floating point calculations are not exact. That is because the binary representations of decimal numbers introduces an error when it is truncated to a fixed length. That means any test for equality must allow some tolerance.
If you multiply by 100 and work with integers the calculations will be exact, though you would have to forgo division.
It is just a fact of life that floating point calculations are not exact. That is because the binary representations of decimal numbers introduces an error when it is truncated to a fixed length. That means any test for equality must allow some tolerance.
If you multiply by 100 and work with integers the calculations will be exact, though you would have to forgo division.