[Python-checkins] r79552 - python/branches/py3k-cdecimal/Lib/test/decimal_extended_tests/deccheck.py
stefan.krah
python-checkins at python.org
Thu Apr 1 12:08:10 CEST 2010
Author: stefan.krah
Date: Thu Apr 1 12:08:10 2010
New Revision: 79552
Log:
Add/explain unresolved differences in three arg power.
Modified:
python/branches/py3k-cdecimal/Lib/test/decimal_extended_tests/deccheck.py
Modified: python/branches/py3k-cdecimal/Lib/test/decimal_extended_tests/deccheck.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/test/decimal_extended_tests/deccheck.py (original)
+++ python/branches/py3k-cdecimal/Lib/test/decimal_extended_tests/deccheck.py Thu Apr 1 12:08:10 2010
@@ -281,12 +281,16 @@
def __pow__(self, result, operands):
"""See DIFFERENCES.txt"""
if operands[2] is not None: # three argument __pow__
+ # issue7049: third arg must fit into precision
if (operands[0].mpd.is_zero() != operands[1].mpd.is_zero()):
if (result.mpd == 0 or result.mpd == 1) and result.dec.is_nan():
if (not context.f.flags[cdecimal.InvalidOperation]) and \
context.d.flags[decimal.InvalidOperation]:
self.powmod_zeros += 1
return True
+ # issue7049: ideal exponent
+ if decimal.Decimal(str(result.mpd)) == result.dec:
+ return True
elif context.f.flags[cdecimal.Rounded] and \
context.f.flags[cdecimal.Inexact] and \
context.d.flags[decimal.Rounded] and \
More information about the Python-checkins
mailing list