From 4bd810aaf215028fd0f512fd646e86ed6e27038d Mon Sep 17 00:00:00 2001 From: Tim Peters Date: Thu, 6 Sep 2001 22:03:36 +0000 Subject: [PATCH] Added some underflow-to-0.0 long/long true division tests. --- Lib/test/test_long_future.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Lib/test/test_long_future.py b/Lib/test/test_long_future.py index 9321f70e246..03d09fca536 100644 --- a/Lib/test/test_long_future.py +++ b/Lib/test/test_long_future.py @@ -37,6 +37,12 @@ def test_true_division(): else: raise TestFailed("expected OverflowError from %r" % overflow) + for underflow in ["1 / huge", "2L / huge", "-1 / huge", "-2L / huge", + "100 / mhuge", "100L / mhuge"]: + result = eval(underflow, namespace) + if result != 0.0: + raise TestFailed("expected undeflow to 0 from %r" % undeflow) + for zero in ["huge / 0", "huge / 0L", "mhuge / 0", "mhuge / 0L"]: try: