File this one under "frustration" or "confusing".

It seems that our beloved ColdFusion rounds numbers with repeating decimals for you when doing division, even when you don't want it to. Consider the following equations:

view plain print about
160 / 55                        = 1.0909090909
240 / 55                        = 0.7272727273
31.0909090909 / 0.7272727273        = 1.4999999999
4(60 / 55) / (40 / 55)                = 1.5

The last line is what CF9 displays. Terrible.

When using numberformat(), it took me giving it a mask of 15 places to get it to show 1.499999999999998, If I dropped it to 14 places, it showed 1.50000000000000.

This makes CF unusable for exact math.

JavaScript, on the other hand, does no such rounding. It gives you the divided number as-is, no rounding.

Bad Adobe.