I happened upon these values in my ColdFusion code but the Google calculator seems to have the same “bug” where the difference is non-zero.
416582.2850 – 411476.8100 – 5105.475 = -2.36468622461E-011
JavaCast’ing these to long/float/double doesn’t help- it results in other non-zero differences.
This is because decimal numbers that “look” round in base 10, are not exactly representable in base 2 (which is what computers use to represent floating point numbers). Please see the article What Every Computer Scientist Should Know About Floating-Point Arithmetic for a detailed explanation of this problem and workarounds.