summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_float.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_float.py')
-rw-r--r--Lib/test/test_float.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/Lib/test/test_float.py b/Lib/test/test_float.py
index 66726d6..a16c05c 100644
--- a/Lib/test/test_float.py
+++ b/Lib/test/test_float.py
@@ -617,6 +617,12 @@ class IEEEFormatTestCase(unittest.TestCase):
('<f', LE_FLOAT_NAN)]:
struct.unpack(fmt, data)
+ @support.requires_IEEE_754
+ def test_serialized_float_rounding(self):
+ from _testcapi import FLT_MAX
+ self.assertEqual(struct.pack("<f", 3.40282356e38), struct.pack("<f", FLT_MAX))
+ self.assertEqual(struct.pack("<f", -3.40282356e38), struct.pack("<f", -FLT_MAX))
+
class FormatTestCase(unittest.TestCase):
def test_format(self):