Kaydet (Commit) 62764566 authored tarafından Mark Dickinson's avatar Mark Dickinson

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.
üst 2affb40e
......@@ -362,10 +362,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 = [
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment