http://qs321.pair.com?node_id=944746


in reply to expected 0 not result gotten

Wise Man Say:   “Floating point numbers like little piles of sand.   Each time you pick one up and move it around, you lose a little sand and pick up a little dirt.”

Replies are listed 'Best First'.
Re^2: expected 0 not result gotten
by ikegami (Patriarch) on Dec 22, 2011 at 20:38 UTC

    Except that's not quite true. Each time you pick one up and move it around, you may lose a little sand. "Sand" is only lost when the number has a huge (>53) number of digits in binary.

    This usually happens because of the use of numbers that are periodic in binary; they have an infinite number of digits. The OP used 425/10000 and 25/10000 which are both periodic in binary (like 1/3 is in decimal).