diff options
author | Mark Dickinson <dickinsm@gmail.com> | 2010-06-20 20:01:04 (GMT) |
---|---|---|
committer | Mark Dickinson <dickinsm@gmail.com> | 2010-06-20 20:01:04 (GMT) |
commit | 6ded1d56872e1de9f856e26098d66256fd51f2b9 (patch) | |
tree | de8dd48377cf890146b027a4b11ede39f1d7320b /Lib/test/test_strtod.py | |
parent | 851ffef6bec645a35f5012bf5e8d7a9a453bf7d6 (diff) | |
download | cpython-6ded1d56872e1de9f856e26098d66256fd51f2b9.zip cpython-6ded1d56872e1de9f856e26098d66256fd51f2b9.tar.gz cpython-6ded1d56872e1de9f856e26098d66256fd51f2b9.tar.bz2 |
Merged revisions 82117 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r82117 | mark.dickinson | 2010-06-20 19:50:19 +0100 (Sun, 20 Jun 2010) | 1 line
Merge test_strtod and test_float string-to-float conversion tests.
........
Diffstat (limited to 'Lib/test/test_strtod.py')
-rw-r--r-- | Lib/test/test_strtod.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Lib/test/test_strtod.py b/Lib/test/test_strtod.py index e99693c..127e868 100644 --- a/Lib/test/test_strtod.py +++ b/Lib/test/test_strtod.py @@ -23,6 +23,8 @@ strtod_parser = re.compile(r""" # A numeric string consists of: \Z """, re.VERBOSE | re.IGNORECASE).match +# Pure Python version of correctly rounded string->float conversion. +# Avoids any use of floating-point by returning the result as a hex string. def strtod(s, mant_dig=53, min_exp = -1021, max_exp = 1024): """Convert a finite decimal string to a hex string representing an IEEE 754 binary64 float. Return 'inf' or '-inf' on overflow. @@ -259,6 +261,10 @@ class StrtodTests(unittest.TestCase): '18487398785991994634182916638542680759613590482273e-357', '32002864200581033134358724675198044527469366773928e-358', '94393431193180696942841837085033647913224148539854e-358', + '73608278998966969345824653500136787876436005957953e-358', + '64774478836417299491718435234611299336288082136054e-358', + '13704940134126574534878641876947980878824688451169e-357', + '46697445774047060960624497964425416610480524760471e-358', # failing case for bug introduced by METD in r77451 (attempted # fix for issue 7632, bug 2), and fixed in r77482. '28639097178261763178489759107321392745108491825303e-311', |