summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Dickinson <dickinsm@gmail.com>2009-10-07 19:24:43 +0000
committerMark Dickinson <dickinsm@gmail.com>2009-10-07 19:24:43 +0000
commitb090761ec035153ff9ac192a0a17ffd7d3706830 (patch)
tree5a3486af0bd18fed9ed58348c74df1bfd176deb7
parentbf0770dd82b8629af60cb3c16d75a436788f2eca (diff)
downloadcpython-git-b090761ec035153ff9ac192a0a17ffd7d3706830.tar.gz
Merged revisions 75276 via svnmerge from
svn+ssh://pythondev@www.python.org/python/branches/py3k ................ r75276 | mark.dickinson | 2009-10-07 20:23:50 +0100 (Wed, 07 Oct 2009) | 12 lines Merged revisions 75275 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r75275 | mark.dickinson | 2009-10-07 20:22:05 +0100 (Wed, 07 Oct 2009) | 6 lines Issue #7048: logb should round its result when that result doesn't fit into the available precision. (Tests for this change are included in the most recent set of testcases from the Decimal Specification site; those testcases will be updated shortly.) ........ ................
-rw-r--r--Lib/decimal.py3
-rw-r--r--Misc/NEWS3
2 files changed, 5 insertions, 1 deletions
diff --git a/Lib/decimal.py b/Lib/decimal.py
index e3fa8cb84f..62dcd40b22 100644
--- a/Lib/decimal.py
+++ b/Lib/decimal.py
@@ -3209,7 +3209,8 @@ class Decimal(object):
# otherwise, simply return the adjusted exponent of self, as a
# Decimal. Note that no attempt is made to fit the result
# into the current context.
- return Decimal(self.adjusted())
+ ans = Decimal(self.adjusted())
+ return ans._fix(context)
def _islogical(self):
"""Return True if self is a logical operand.
diff --git a/Misc/NEWS b/Misc/NEWS
index 0420a82bd9..4b6ff0b514 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -27,6 +27,9 @@ Core and Builtins
Library
-------
+- Issue #7048: Force Decimal.logb to round its result when that result
+ is too large to fit in the current precision.
+
- Issue #6236, #6348: Fix various failures in the I/O library under AIX
and other platforms, when using a non-gcc compiler. Patch by egreen.