Macintosh: "Rounding Errors"

I'm having trouble doing a simple math calculation with FileMaker II. All subsequent programs I tried produced the same mathematical "error" (Excel and the Calculator desk accessory are a couple).

The calculation is very simple: 1194.6 - 500 - 640 - 54.6 = X

The result should be 0; however, all software produced the result -2.428612866E-17.

I can cure this problem in FileMaker II by rounding the result to two decimal places, but I am very interested in why the result does not go to zero. My IBM PC produced the same result. I gather the answer lies in the way personal computers handle subtraction.

The rounding errors you have run into on the Macintosh and IBM PC have been around since the beginning of personal computers (and longer!).

Computers must convert from a floating point decimal number to binary in order for the CPU to do math operations. To make the conversion process perform at a user-tolerable rate, past computer designers came up with "short cut" processes to do the conversion. These short cuts cause slight rounding errors.

In the example you describe, the error is .00000000000000002486.... This can be annoying, but is a good trade-off for the amount of time that is saved when doing math functions.
Published Date: Feb 18, 2012