Daniel Urban <urban.dani...@gmail.com> added the comment:

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
>>>

----------
nosy: +durban
type: crash -> behavior
versions: +Python 3.1, Python 3.2, Python 3.3

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue11680>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to