Message6210

Author mulleteer
Recipients mulleteer
Date 2010-10-26.14:47:15
SpamBayes Score 2.4118874e-11
Marked as misclassified No
Message-id <1288104436.31.0.255376224952.issue1670@psf.upfronthosting.co.za>
In-reply-to
Content
Implicit Decimal conversion fails 

Jython 2.5.2rc2 (Release_2_5_2rc2:7167, Oct 24 2010, 22:48:30) 
[Java HotSpot(TM) 64-Bit Server VM (Sun Microsystems Inc.)] on java1.6.0_21
Type "help", "copyright", "credits" or "license" for more information.
>>> import math
>>> from decimal import Decimal as D
>>> math.fabs(D('23.23'))
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: fabs(): 1st arg can't be coerced to double

But this works.

>>> math.fabs(float(D('23.23')))
23.23
History
Date User Action Args
2010-10-26 14:47:16mulleteersetrecipients: + mulleteer
2010-10-26 14:47:16mulleteersetmessageid: <1288104436.31.0.255376224952.issue1670@psf.upfronthosting.co.za>
2010-10-26 14:47:16mulleteerlinkissue1670 messages
2010-10-26 14:47:15mulleteercreate