Decimal is very slow compared to binary floating point, and a Decimal() with default precision is 5× larger than a Python float. Using lots of them will chew through memory quickly. You can still run into precision problems using Decimal(), but you've really got to try hard to do that.
Binary floating point is a decent compromise between speed, compactness, precision and predictability. There are always numbers you can't store exactly in any notation.
Binary floating point is a decent compromise between speed, compactness, precision and predictability. There are always numbers you can't store exactly in any notation.
Statistics: Posted by scruss — Sun Jan 04, 2026 4:53 pm