Discussion:
[Python-3000-checkins] r65009 - in python/branches/py3k: Lib/test/test_float.py
mark.dickinson
2008-07-16 11:32:31 UTC
Permalink
Author: mark.dickinson
Date: Wed Jul 16 13:32:23 2008
New Revision: 65009

Log:
Merged revisions 64981 via svnmerge from
svn+ssh://pythondev at 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.
........


Modified:
python/branches/py3k/ (props changed)
python/branches/py3k/Lib/test/test_float.py

Modified: python/branches/py3k/Lib/test/test_float.py
==============================================================================
--- python/branches/py3k/Lib/test/test_float.py (original)
+++ python/branches/py3k/Lib/test/test_float.py Wed Jul 16 13:32:23 2008
@@ -377,10 +377,10 @@
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 = [

Loading...