Message6210
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 |
|
Date |
User |
Action |
Args |
2010-10-26 14:47:16 | mulleteer | set | recipients:
+ mulleteer |
2010-10-26 14:47:16 | mulleteer | set | messageid: <1288104436.31.0.255376224952.issue1670@psf.upfronthosting.co.za> |
2010-10-26 14:47:16 | mulleteer | link | issue1670 messages |
2010-10-26 14:47:15 | mulleteer | create | |
|