diff options
author | Mark Dickinson <dickinsm@gmail.com> | 2009-10-07 19:22:05 (GMT) |
---|---|---|
committer | Mark Dickinson <dickinsm@gmail.com> | 2009-10-07 19:22:05 (GMT) |
commit | 15ae41c2db8b0779a7f584c238a8e9efe6e370b3 (patch) | |
tree | c91282c5b6dccdf1c686946c8fbab3b29476ee40 | |
parent | 590ecf34ffcf3c09c3c26c075db44bae735e54a4 (diff) | |
download | cpython-15ae41c2db8b0779a7f584c238a8e9efe6e370b3.zip cpython-15ae41c2db8b0779a7f584c238a8e9efe6e370b3.tar.gz cpython-15ae41c2db8b0779a7f584c238a8e9efe6e370b3.tar.bz2 |
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.py | 3 | ||||
-rw-r--r-- | Misc/NEWS | 3 |
2 files changed, 5 insertions, 1 deletions
diff --git a/Lib/decimal.py b/Lib/decimal.py index 4d1f7f9..75e5eea 100644 --- a/Lib/decimal.py +++ b/Lib/decimal.py @@ -3126,7 +3126,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. @@ -398,6 +398,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 #6516: Added owner/group support when creating tar archives in Distutils. |