diff options
author | Mark Dickinson <dickinsm@gmail.com> | 2010-01-16 17:57:49 (GMT) |
---|---|---|
committer | Mark Dickinson <dickinsm@gmail.com> | 2010-01-16 17:57:49 (GMT) |
commit | 811ff822f8cd87cf29867118cb3a74c5035a1a94 (patch) | |
tree | 037219175275142c50e95012e821cddf33bccbd8 /Lib/test/test_strtod.py | |
parent | db983a7c38ba3d98649c916afa12340bd8b6bed2 (diff) | |
download | cpython-811ff822f8cd87cf29867118cb3a74c5035a1a94.zip cpython-811ff822f8cd87cf29867118cb3a74c5035a1a94.tar.gz cpython-811ff822f8cd87cf29867118cb3a74c5035a1a94.tar.bz2 |
Issue #7632: Fix one more case of incorrect rounding for str -> float
conversion (see bug 5 in the issue tracker).
Diffstat (limited to 'Lib/test/test_strtod.py')
-rw-r--r-- | Lib/test/test_strtod.py | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/Lib/test/test_strtod.py b/Lib/test/test_strtod.py index 0c6f59d..1883820 100644 --- a/Lib/test/test_strtod.py +++ b/Lib/test/test_strtod.py @@ -123,10 +123,6 @@ class StrtodTests(unittest.TestCase): digits = m * 5**-e exponent = e s = '{}e{}'.format(digits, exponent) - - # for the moment, ignore errors from trailing zeros - if digits % 10 == 0: - continue self.check_strtod(s) # get expected answer via struct, to triple check @@ -175,7 +171,8 @@ class StrtodTests(unittest.TestCase): self.check_strtod(s) def test_parsing(self): - digits = tuple(map(str, xrange(10))) + # make '0' more likely to be chosen than other digits + digits = '000000123456789' signs = ('+', '-', '') # put together random short valid strings @@ -257,7 +254,7 @@ class StrtodTests(unittest.TestCase): '247032822920623295e-341', # issue 7632 bug 5: the following 2 strings convert differently '1000000000000000000000000000000000000000e-16', - #'10000000000000000000000000000000000000000e-17', + '10000000000000000000000000000000000000000e-17', # issue 7632 bug 8: the following produced 10.0 '10.900000000000000012345678912345678912345', ] |