Binary floating-point cannot precisely represent 1.1 — it's an infinitely repeating sequence of digits — so it uses a number very close to 1.1 that rounds to 1.10000002 in decimal. You should never, ever count on floating-point numbers to be accurate, and you shouldn't test for equality either — test whether a number is within a tiny range around the number you're interested in (e.g. x - 0.0000001 < n && x + 0.0000001 > n).