3 ms·
> Floating point numbers lose precision because binary arithmetic doesn't represent decimal in all cases. That’s not the reason. A counterexample is decimal ar
by Someone 4y ago
> Floating point numbers lose precision because binary arithmetic doesn't represent decimal in all cases.
That’s not the reason. A counterexample is decimal arithmetic. That represents decimal in all cases, yet loses precision when doing calculations. Once you start doing division that applies even to arbitrarily sized decimal numbers.
The correct reason is because the subset of the reals that is representable as IEEE float isn’t closed under the operations people want to perform on them, including the basic ones of addition, multiplication and division.