summaryrefslogtreecommitdiff
path: root/Lib/test/test_float.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2008-01-05 00:59:59 +0000
committerGuido van Rossum <guido@python.org>2008-01-05 00:59:59 +0000
commit6e61ceaa1b5f132c67ddc86dd0fa0085969152d5 (patch)
tree910f7654fc0aa5a3d2bffb3acb9c54410946f7ca /Lib/test/test_float.py
parentbf9d5c36a90052662cac7f6d9c88b488dc5237c0 (diff)
downloadcpython-6e61ceaa1b5f132c67ddc86dd0fa0085969152d5.tar.gz
Patch #1725 by Mark Dickinson, fixes incorrect conversion of -1e1000
and adds errors for -0x.
Diffstat (limited to 'Lib/test/test_float.py')
-rw-r--r--Lib/test/test_float.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/Lib/test/test_float.py b/Lib/test/test_float.py
index 11f169054a..9d330403aa 100644
--- a/Lib/test/test_float.py
+++ b/Lib/test/test_float.py
@@ -121,6 +121,13 @@ class IEEEFormatTestCase(unittest.TestCase):
self.assertEquals(pos_pos(), neg_pos())
self.assertEquals(pos_neg(), neg_neg())
+ if float.__getformat__("double").startswith("IEEE"):
+ def test_underflow_sign(self):
+ import math
+ # check that -1e-1000 gives -0.0, not 0.0
+ self.assertEquals(math.atan2(-1e-1000, -1), math.atan2(-0.0, -1))
+ self.assertEquals(math.atan2(float('-1e-1000'), -1),
+ math.atan2(-0.0, -1))
class ReprTestCase(unittest.TestCase):
def test_repr(self):