Author skrah
Recipients mark.dickinson, skrah
Date 2009-10-29.09:21:01
SpamBayes Score 7.94472e-06
Marked as misclassified No
Message-id <1256808063.4.0.75529666771.issue7233@psf.upfronthosting.co.za>
In-reply-to
Content
Hi,

I got two issues with the all-important function rotate():

1. It should probably convert an integer argument:

>>> from decimal import *
>>> c = getcontext()
>>> c.prec = 4
>>> Decimal("1000000000").rotate(1)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.7/decimal.py", line 3411, in rotate
    ans = self._check_nans(other, context)
  File "/usr/lib/python2.7/decimal.py", line 738, in _check_nans
    other_is_nan = other._isnan()


2. When the coefficient size is greater than prec, the most significant
digits should be truncated before rotating:

>>> c.prec = 4
>>> Decimal("1000000000").rotate(Decimal(1))
Decimal('1')


The result should be 0 (checked against decNumber).
History
Date User Action Args
2009-10-29 09:21:03skrahsetrecipients: + skrah, mark.dickinson
2009-10-29 09:21:03skrahsetmessageid: <1256808063.4.0.75529666771.issue7233@psf.upfronthosting.co.za>
2009-10-29 09:21:02skrahlinkissue7233 messages
2009-10-29 09:21:01skrahcreate