2 ms·
They aren't really problems. As was pointed out, this is the way floating point works. It trades (decimal) precision for speed. Personally, I do wish that Py
by timwiseman 17y ago
They aren't really problems. As was pointed out, this is the way floating point works. It trades (decimal) precision for speed. Personally, I do wish that Python would default to a fixed precision decimal style instead of defaulting to floating point.
But, you can make Python use the decimal style if you use the Decimal (or similar) library. Also, you can use certain wrappers for Python such as Sage to do something similar. I am a great fan of Sage for certain tasks personally.