diff options
author | Mark Dickinson <dickinsm@gmail.com> | 2010-04-05 18:09:39 (GMT) |
---|---|---|
committer | Mark Dickinson <dickinsm@gmail.com> | 2010-04-05 18:09:39 (GMT) |
commit | 5daab45158094e577b9791cda7d8a0f4e34f45cb (patch) | |
tree | bc65e628f6031555938699b90b611facb5d5a9ba /Lib/test/test_float.py | |
parent | 19192dd4022e1ce3978ac9b52a95deef430d46f8 (diff) | |
download | cpython-5daab45158094e577b9791cda7d8a0f4e34f45cb.zip cpython-5daab45158094e577b9791cda7d8a0f4e34f45cb.tar.gz cpython-5daab45158094e577b9791cda7d8a0f4e34f45cb.tar.bz2 |
Merged revisions 79804 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r79804 | mark.dickinson | 2010-04-05 19:07:51 +0100 (Mon, 05 Apr 2010) | 5 lines
Use a more robust infinity check in _Py_HashDouble.
This fixes a test_decimal failure on FreeBSD 8.0. (modf apparently
doesn't follow C99 Annex F on FreeBSD.)
........
Diffstat (limited to 'Lib/test/test_float.py')
-rw-r--r-- | Lib/test/test_float.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/Lib/test/test_float.py b/Lib/test/test_float.py index cabeb16..b52b1db 100644 --- a/Lib/test/test_float.py +++ b/Lib/test/test_float.py @@ -914,6 +914,15 @@ class InfNanTest(unittest.TestCase): self.assertFalse(NAN.is_inf()) self.assertFalse((0.).is_inf()) + def test_hash_inf(self): + # the actual values here should be regarded as an + # implementation detail, but they need to be + # identical to those used in the Decimal module. + self.assertEqual(hash(float('inf')), 314159) + self.assertEqual(hash(float('-inf')), -271828) + self.assertEqual(hash(float('nan')), 0) + + fromHex = float.fromhex toHex = float.hex class HexFloatTestCase(unittest.TestCase): |