7 Mar
2014
7 Mar
'14
8:11 a.m.
Mark H. Harris
You can't be serious. You have not commented yet... are you happy with this:
from decimal import Decimal a=Decimal(1) b=Decimal(.1) a+b Decimal('1.100000000000000005551115123') <==== does this not bother you at all ?
You can set a trap:
getcontext().traps[FloatOperation] = True b = Decimal(.1) Traceback (most recent call last): File "<stdin>", line 1, in <module> decimal.FloatOperation: [
]
Stefan Krah