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).

This commit is contained in:
Mark Dickinson 2009-12-27 16:16:02 +00:00
parent 4657283647
commit 4c96035f33
1 changed files with 2 additions and 1 deletions

View File

@ -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):