Message94649
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). |
|
| Date |
User |
Action |
Args |
| 2009-10-29 09:21:03 | skrah | set | recipients:
+ skrah, mark.dickinson |
| 2009-10-29 09:21:03 | skrah | set | messageid: <1256808063.4.0.75529666771.issue7233@psf.upfronthosting.co.za> |
| 2009-10-29 09:21:02 | skrah | link | issue7233 messages |
| 2009-10-29 09:21:01 | skrah | create | |
|