posted 13 years ago
Basically, 1/10 in binary ends up as an infinitely repeating series of digits. Like 1/3 = 0.333333... in decimal. If you had two decimal formats, one with 4 digits and one with 4, you couldn't expect 1/3 to be the same in both formats, because one is 0.3333 and the other is 0.33333333. It's the same thing with 1/10 in decimal. Basically when you use floatng point, you can't really trust the == operator as the numbers involved may be slightly rounded up or down by various effects.