0.2 = 2 * 1/10, 0.8 = 8 * 1/10. 1/10 is a repeating decimal in base-2, just like 1/3 is a repeating decimal in base-10. (In fact, any fraction whose denominator is not a power of 2 will have an infinite representation in base-2.) Computers are always working in base-2. If you round the binary representation of 0.1 to 24 bits, the result is the value 0.100000001490116119384765625. Floating-point arithmetic has problems, as well. For example (using 24-bit representations), 0.1 * 0.1 results in ~0.0100000003, whereas the representable number closest to 0.01 (the correct answer) is ~0.0099999998. For more fun, addition and multiplication remain commutative (a + b = b + a) in floating-point arithmetic, but they are not associative ((a + b) + c =/= a + (b + c)) or distributive ((a + b) * c =/= a * c + b * c). Floating-point precision errors have gotten people killed .