Author skrah
Recipients mark.dickinson, rhettinger, skrah
Date 2010-12-08.13:56:10
SpamBayes Score 1.8602e-06
Marked as misclassified No
Message-id <1291816575.32.0.784106881295.issue10650@psf.upfronthosting.co.za>
In-reply-to
Content
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')
History
Date User Action Args
2010-12-08 13:56:15skrahsetrecipients: + skrah, rhettinger, mark.dickinson
2010-12-08 13:56:15skrahsetmessageid: <1291816575.32.0.784106881295.issue10650@psf.upfronthosting.co.za>
2010-12-08 13:56:10skrahlinkissue10650 messages
2010-12-08 13:56:10skrahcreate