This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author daniel.urban
Recipients daniel.urban, daveabailey
Date 2011-03-26.08:44:33
SpamBayes Score 1.7017194e-06
Marked as misclassified No
Message-id <1301129073.82.0.645698675144.issue11680@psf.upfronthosting.co.za>
In-reply-to
Content
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
>>>
History
Date User Action Args
2011-03-26 08:44:33daniel.urbansetrecipients: + daniel.urban, daveabailey
2011-03-26 08:44:33daniel.urbansetmessageid: <1301129073.82.0.645698675144.issue11680@psf.upfronthosting.co.za>
2011-03-26 08:44:33daniel.urbanlinkissue11680 messages
2011-03-26 08:44:33daniel.urbancreate