diff options
author | Mark Dickinson <dickinsm@gmail.com> | 2008-07-16 11:32:23 (GMT) |
---|---|---|
committer | Mark Dickinson <dickinsm@gmail.com> | 2008-07-16 11:32:23 (GMT) |
commit | 38bbc4888a1fcbcedd7eb8b83ac4b070f2aeb5f2 (patch) | |
tree | dcbe1c165328ff91ca962926002fbd3cac005bd1 /Lib/test/test_float.py | |
parent | 65fe25e59710eada7eb41bddb45bdca8b61b5668 (diff) | |
download | cpython-38bbc4888a1fcbcedd7eb8b83ac4b070f2aeb5f2.zip cpython-38bbc4888a1fcbcedd7eb8b83ac4b070f2aeb5f2.tar.gz cpython-38bbc4888a1fcbcedd7eb8b83ac4b070f2aeb5f2.tar.bz2 |
Merged revisions 64981 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r64981 | mark.dickinson | 2008-07-15 22:55:23 +0100 (Tue, 15 Jul 2008) | 4 lines
Fix float.from_hex tests. It appears that Linux/ia64 doesn't like
computing 2.0**-1074 accurately. Using ldexp(1.0, -1074) should be
safer.
........
Diffstat (limited to 'Lib/test/test_float.py')
-rw-r--r-- | Lib/test/test_float.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Lib/test/test_float.py b/Lib/test/test_float.py index 9b84531..7de5320 100644 --- a/Lib/test/test_float.py +++ b/Lib/test/test_float.py @@ -377,10 +377,10 @@ class HexFloatTestCase(unittest.TestCase): self.fail('%r not identical to %r' % (x, y)) def test_ends(self): - self.identical(self.MIN, 2.**-1022) - self.identical(self.TINY, 2.**-1074) - self.identical(self.EPS, 2.**-52) - self.identical(self.MAX, 2.*(2.**1023 - 2.**970)) + self.identical(self.MIN, ldexp(1.0, -1022)) + self.identical(self.TINY, ldexp(1.0, -1074)) + self.identical(self.EPS, ldexp(1.0, -52)) + self.identical(self.MAX, 2.*(ldexp(1.0, 1023) - ldexp(1.0, 970))) def test_invalid_inputs(self): invalid_inputs = [ |