3 ms·
Well, it is, but it's still exact. Think of it a while, in base-10 (if it makes it easier for you). Let's say you save numbers in format a * 10^b. B has enough
by Tuna-Fish 14y ago
Well, it is, but it's still exact. Think of it a while, in base-10 (if it makes it easier for you).
Let's say you save numbers in format a * 10^b. B has enough range to not to be a problem, but a can only hold 3 digits. What integers can you represent exactly?
1 = 1.00 * 10^0. 2 = 2.00 * 10^1, trough to 999 = 9.99*10^2.
Or in other words, so long as mantissa has less bits than the number you are converting, it can be represented perfectly in floating point. So, 4 is always 4, not some number very close to 4. If it ends up as something else, you're the one who has messed it up.