Comparing floating point numbers

Due to the "floating point" representation of numbers, some numbers such as .35 turn into .34999999999999998 when stored in a binary format.

Typically this accuracy is adequate for normal processing. But, when a model represents percentages as fractions, this loss of precision means the aggregation adds up to .99999999999999998 instead of 1.0.

If a rule is triggered when the aggregate of the percentages is 1 (100%), then most combinations of percentages will trigger the rule. But, in some cases due to the floating point representation, the totals do not completely add up to 1, so the 1.0 total is never reached and the rule is not triggered.

To avoid this problem, you can represent percentages as whole numbers (35 instead of 0.35 for 35%) or rework the rule so that the comparison between the aggregation and 1 doesn't have to be exact.