summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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 43244308c0..d589fd779f 100644
--- a/Lib/decimal.py
+++ b/Lib/decimal.py
@@ -3083,7 +3083,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 53d172113b..a1a53a7223 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -22,6 +22,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.
+
Tests
-----