http://www.perlmonks.org?node_id=1082493


in reply to Comparing results of math operations

Floating-point number like little pile of sand on the ground. Each time you pick it up and move it around, you lose a little sand (precision) and pick up a little dirt (error). Rounding and such masks this effect but does not get rid of it. Add up enough numbers and you will see (to the vexation of your accountant) that the total at the bottom is "off by a few cents." In fact, the total is correct, because it is the sum of non-rounded numbers, whereas the check performed by the calculator-toting accountant is the sum of rounded numbers.