diff --git a/Lib/decimal.py b/Lib/decimal.py index 33f539178be..5045722f5b1 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 3937389a493..42c7454bf59 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -87,6 +87,9 @@ C-API 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.