Message132218
The problem seems to be that you're calling Decimal.from_float with a Decimal instance, not a float. I'm not sure that should even work. The Decimal constructor can create a decimal from an other decimal.
Your suggested solution probably would solve this exception, but I'm not sure it would be the good solution. This way when creating a decimal from another decimal with from_float (which doesn't makes much sense, I think) could result in a loss of precision:
>>> Decimal(Decimal('0.999999999999999999999'))
Decimal('0.999999999999999999999')
>>>
>>> math.fabs(Decimal('0.999999999999999999999'))
1.0
>>> |
|
Date |
User |
Action |
Args |
2011-03-26 08:44:33 | daniel.urban | set | recipients:
+ daniel.urban, daveabailey |
2011-03-26 08:44:33 | daniel.urban | set | messageid: <1301129073.82.0.645698675144.issue11680@psf.upfronthosting.co.za> |
2011-03-26 08:44:33 | daniel.urban | link | issue11680 messages |
2011-03-26 08:44:33 | daniel.urban | create | |
|