New submission from Stefan Krah <stefan-use...@bytereef.org>: 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). ---------- messages: 94649 nosy: mark.dickinson, skrah severity: normal status: open title: decimal.py: two rotate() issues versions: Python 2.6, Python 2.7 _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue7233> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com