diff options
author | Mark Dickinson <dickinsm@gmail.com> | 2009-12-27 16:16:02 (GMT) |
---|---|---|
committer | Mark Dickinson <dickinsm@gmail.com> | 2009-12-27 16:16:02 (GMT) |
commit | 4c96035f3361d50a6bf40557f04d45244af3dec9 (patch) | |
tree | 13c7cd61b0c8ab8623d3b8fa938352e38afc7689 /Lib/test/test_long_future.py | |
parent | 465728364749e903fb4293b2f7a266b58de6bde4 (diff) | |
download | cpython-4c96035f3361d50a6bf40557f04d45244af3dec9.zip cpython-4c96035f3361d50a6bf40557f04d45244af3dec9.tar.gz cpython-4c96035f3361d50a6bf40557f04d45244af3dec9.tar.bz2 |
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).
Diffstat (limited to 'Lib/test/test_long_future.py')
-rw-r--r-- | Lib/test/test_long_future.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/test/test_long_future.py b/Lib/test/test_long_future.py index 25462bf..f863d52 100644 --- a/Lib/test/test_long_future.py +++ b/Lib/test/test_long_future.py @@ -5,6 +5,7 @@ from __future__ import division import sys import random +import math import unittest from test.test_support import run_unittest @@ -46,7 +47,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(float(q), exp) return -result if negative else result class TrueDivisionTests(unittest.TestCase): |