]> granicus.if.org Git - python/commitdiff
Merged revisions 75562 via svnmerge from
authorMark Dickinson <dickinsm@gmail.com>
Tue, 20 Oct 2009 13:40:25 +0000 (13:40 +0000)
committerMark Dickinson <dickinsm@gmail.com>
Tue, 20 Oct 2009 13:40:25 +0000 (13:40 +0000)
svn+ssh://pythondev@www.python.org/python/branches/py3k

................
  r75562 | mark.dickinson | 2009-10-20 14:38:04 +0100 (Tue, 20 Oct 2009) | 10 lines

  Merged revisions 75561 via svnmerge from
  svn+ssh://pythondev@svn.python.org/python/trunk

  ........
    r75561 | mark.dickinson | 2009-10-20 14:33:03 +0100 (Tue, 20 Oct 2009) | 3 lines

    Issue #7099: Decimal.is_normal should return True for all nonzero
    finite non-subnormal values, even those with exponent > Emax.
  ........
................

Lib/decimal.py
Lib/test/decimaltestdata/extra.decTest
Misc/NEWS

index 62dcd40b2228cb5c9bc180d9d3ec685718981dc9..b44c3f51de50e82640a6358469667f1a04989a89 100644 (file)
@@ -3000,7 +3000,7 @@ class Decimal(object):
             return False
         if context is None:
             context = getcontext()
-        return context.Emin <= self.adjusted() <= context.Emax
+        return context.Emin <= self.adjusted()
 
     def is_qnan(self):
         """Return True if self is a quiet NaN; otherwise return False."""
index 1d6ea3702ad89f0c0ea8ad89beb3ee13a18f46e0..15c1b528480262a4fb33422ea965b4e17b313042 100644 (file)
@@ -1128,10 +1128,10 @@ bool0932 isnormal 1E+998 -> 1
 bool0933 isnormal -1E+998 -> 1
 bool0934 isnormal 1E+999 -> 1
 bool0935 isnormal -1E+999 -> 1
-bool0936 isnormal 1E+1000 -> 0
-bool0937 isnormal -1E+1000 -> 0
-bool0938 isnormal 1E+2000 -> 0
-bool0939 isnormal -1E+2000 -> 0
+bool0936 isnormal 1E+1000 -> 1
+bool0937 isnormal -1E+1000 -> 1
+bool0938 isnormal 1E+2000 -> 1
+bool0939 isnormal -1E+2000 -> 1
 bool0940 isnormal 9E-2000 -> 0
 bool0941 isnormal -9E-2000 -> 0
 bool0942 isnormal 9E-1008 -> 0
@@ -1178,10 +1178,10 @@ bool0982 isnormal 9E+998 -> 1
 bool0983 isnormal -9E+998 -> 1
 bool0984 isnormal 9E+999 -> 1
 bool0985 isnormal -9E+999 -> 1
-bool0986 isnormal 9E+1000 -> 0
-bool0987 isnormal -9E+1000 -> 0
-bool0988 isnormal 9E+2000 -> 0
-bool0989 isnormal -9E+2000 -> 0
+bool0986 isnormal 9E+1000 -> 1
+bool0987 isnormal -9E+1000 -> 1
+bool0988 isnormal 9E+2000 -> 1
+bool0989 isnormal -9E+2000 -> 1
 bool0990 isnormal 9.99999999E-2000 -> 0
 bool0991 isnormal -9.99999999E-2000 -> 0
 bool0992 isnormal 9.99999999E-1008 -> 0
@@ -1228,10 +1228,10 @@ bool1032 isnormal 9.99999999E+998 -> 1
 bool1033 isnormal -9.99999999E+998 -> 1
 bool1034 isnormal 9.99999999E+999 -> 1
 bool1035 isnormal -9.99999999E+999 -> 1
-bool1036 isnormal 9.99999999E+1000 -> 0
-bool1037 isnormal -9.99999999E+1000 -> 0
-bool1038 isnormal 9.99999999E+2000 -> 0
-bool1039 isnormal -9.99999999E+2000 -> 0
+bool1036 isnormal 9.99999999E+1000 -> 1
+bool1037 isnormal -9.99999999E+1000 -> 1
+bool1038 isnormal 9.99999999E+2000 -> 1
+bool1039 isnormal -9.99999999E+2000 -> 1
 bool1040 isnormal Infinity -> 0
 bool1041 isnormal -Infinity -> 0
 bool1042 isnormal NaN -> 0
index 5d1582017d360f120d554eb2b8707cd6fb4c523d..9935088bbd5122b792f77a28566a531c8cebcd6b 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -30,6 +30,9 @@ Core and Builtins
 Library
 -------
 
+- Issue #7099: Decimal.is_normal now returns True for numbers with exponent
+  larger than emax.
+
 - Issue #7080: locale.strxfrm() raises a MemoryError on 64-bit non-Windows
   platforms, and assorted locale fixes by Derk Drukker.