]> granicus.if.org Git - python/commitdiff
Merged revisions 77066 via svnmerge from
authorMark Dickinson <dickinsm@gmail.com>
Sun, 27 Dec 2009 19:03:31 +0000 (19:03 +0000)
committerMark Dickinson <dickinsm@gmail.com>
Sun, 27 Dec 2009 19:03:31 +0000 (19:03 +0000)
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r77066 | mark.dickinson | 2009-12-27 16:16:02 +0000 (Sun, 27 Dec 2009) | 1 line

  Use ldexp(q, exp) instead of q*2.**exp in true division test, to avoid bogus failures on platforms with broken pow (e.g., Ubuntu/ia64).
........

Lib/test/test_long.py

index 98221e625c32e1674d5159f58adad77923bf7a35..4096f1fadb04c2a018dc9669292adbb5f3a29f5e 100644 (file)
@@ -73,7 +73,7 @@ def truediv(a, b):
     if 2*r > b or 2*r == b and q % 2 == 1:
         q += 1
 
-    result = float(q) * 2.**exp
+    result = math.ldexp(q, exp)
     return -result if negative else result