OLD | NEW |
1 # Tests for the correctly-rounded string -> float conversions | 1 # Tests for the correctly-rounded string -> float conversions |
2 # introduced in Python 2.7 and 3.1. | 2 # introduced in Python 2.7 and 3.1. |
3 | 3 |
4 import random | 4 import random |
5 import struct | 5 import struct |
6 import unittest | 6 import unittest |
7 import re | 7 import re |
8 import sys | 8 import sys |
9 from test import test_support | 9 from test import test_support |
10 | 10 |
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
251 '156000783167963081616214710691759864332339239688734' #... | 251 '156000783167963081616214710691759864332339239688734' #... |
252 '656548790656486646106983450809073750535624894296242' #... | 252 '656548790656486646106983450809073750535624894296242' #... |
253 '072010195710276073042036425579852459556183541199012' #... | 253 '072010195710276073042036425579852459556183541199012' #... |
254 '652571123898996574563824424330960027873516082763671875e-1075', | 254 '652571123898996574563824424330960027873516082763671875e-1075', |
255 # demonstration that original fix for issue 7632 bug 1 was | 255 # demonstration that original fix for issue 7632 bug 1 was |
256 # buggy; the exit condition was too strong | 256 # buggy; the exit condition was too strong |
257 '247032822920623295e-341', | 257 '247032822920623295e-341', |
258 # issue 7632 bug 5: the following 2 strings convert differently | 258 # issue 7632 bug 5: the following 2 strings convert differently |
259 '1000000000000000000000000000000000000000e-16', | 259 '1000000000000000000000000000000000000000e-16', |
260 #'10000000000000000000000000000000000000000e-17', | 260 #'10000000000000000000000000000000000000000e-17', |
| 261 # issue 7632 bug 8: the following produced 10.0 |
| 262 '10.900000000000000012345678912345678912345', |
261 ] | 263 ] |
262 for s in test_strings: | 264 for s in test_strings: |
263 self.check_strtod(s) | 265 self.check_strtod(s) |
264 | 266 |
265 def test_main(): | 267 def test_main(): |
266 test_support.run_unittest(StrtodTests) | 268 test_support.run_unittest(StrtodTests) |
267 | 269 |
268 if __name__ == "__main__": | 270 if __name__ == "__main__": |
269 test_main() | 271 test_main() |
OLD | NEW |