Message123603
I'm not sure if this is a documentation issue or a bug. If watchexp=0,
quantize() also allows any number of digits:
>>> x = Decimal("6885998238912213556789006667970467609814")
>>> y = Decimal("1e2")
>>> x.quantize(y)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python3.2/decimal.py", line 2488, in quantize
'quantize result has too many digits for current context')
File "/usr/local/lib/python3.2/decimal.py", line 3925, in _raise_error
raise error(explanation)
decimal.InvalidOperation: quantize result has too many digits for current context
>>>
>>> x.quantize(y, watchexp=0)
Decimal('6.8859982389122135567890066679704676098E+39') |
|
Date |
User |
Action |
Args |
2010-12-08 13:56:15 | skrah | set | recipients:
+ skrah, rhettinger, mark.dickinson |
2010-12-08 13:56:15 | skrah | set | messageid: <1291816575.32.0.784106881295.issue10650@psf.upfronthosting.co.za> |
2010-12-08 13:56:10 | skrah | link | issue10650 messages |
2010-12-08 13:56:10 | skrah | create | |
|