2 ms·
So much of computing practice is based on the idea that floats aren't quite real numbers, they're like fuzzy analog voltages almost. Almost nobody thinks about
by eternityforest 5y ago
So much of computing practice is based on the idea that floats aren't quite real numbers, they're like fuzzy analog voltages almost.
Almost nobody thinks about float rounding, they just use something precise enough that it doesn't matter, or use integers.
Why break that standard? Everyone expects computer numbers to be just a bit off. If we didn't we would do a lot of stuff differently in incompatible ways.
Seems like it would hurt the Python ecosystem if people wrote stuff that assumed floats were perfect decimals, and encouraged code that depends on that.
You'd get stuff like serializing to JSON, and reading in some other language with a JSON parser that doesn't know the numbers need to be precise.
Plus, it's just faster.