3 ms·
You're right about those Python cases (and they are surprising!). But if you're dealing with numbers those big and adding decimals you would want to use the Dec
by orf 9y ago
You're right about those Python cases (and they are surprising!). But if you're dealing with numbers those big and adding decimals you would want to use the Decimal module:
>> from decimal import Decimal as D
>> 9007199254740991 + D('0.1')
> Decimal('9007199254740991.1')