(self)
| 175 | |
| 176 | @unittest.expectedFailure # TODO: RUSTPYTHON |
| 177 | def test_boundaries(self): |
| 178 | # boundaries expressed as triples (n, e, u), where |
| 179 | # n*10**e is an approximation to the boundary value and |
| 180 | # u*10**e is 1ulp |
| 181 | boundaries = [ |
| 182 | (10000000000000000000, -19, 1110), # a power of 2 boundary (1.0) |
| 183 | (17976931348623159077, 289, 1995), # overflow boundary (2.**1024) |
| 184 | (22250738585072013831, -327, 4941), # normal/subnormal (2.**-1022) |
| 185 | (0, -327, 4941), # zero |
| 186 | ] |
| 187 | for n, e, u in boundaries: |
| 188 | for j in range(1000): |
| 189 | digits = n + random.randrange(-3*u, 3*u) |
| 190 | exponent = e |
| 191 | s = '{}e{}'.format(digits, exponent) |
| 192 | self.check_strtod(s) |
| 193 | n *= 10 |
| 194 | u *= 10 |
| 195 | e -= 1 |
| 196 | |
| 197 | @unittest.expectedFailure # TODO: RUSTPYTHON |
| 198 | def test_underflow_boundary(self): |
nothing calls this directly
no test coverage detected