MCPcopy Index your code
hub / github.com/numpy/numpy / test_floating_overflow

Method test_floating_overflow

numpy/_core/tests/test_scalar_ctors.py:20–38  ·  view source on GitHub ↗

Strings containing an unrepresentable float overflow

(self)

Source from the content-addressed store, hash-verified

18 assert_almost_equal(flongdouble, 1.234)
19
20 def test_floating_overflow(self):
21 """ Strings containing an unrepresentable float overflow """
22 fhalf = np.half('1e10000')
23 assert_equal(fhalf, np.inf)
24 fsingle = np.single('1e10000')
25 assert_equal(fsingle, np.inf)
26 fdouble = np.double('1e10000')
27 assert_equal(fdouble, np.inf)
28 flongdouble = pytest.warns(RuntimeWarning, np.longdouble, '1e10000')
29 assert_equal(flongdouble, np.inf)
30
31 fhalf = np.half('-1e10000')
32 assert_equal(fhalf, -np.inf)
33 fsingle = np.single('-1e10000')
34 assert_equal(fsingle, -np.inf)
35 fdouble = np.double('-1e10000')
36 assert_equal(fdouble, -np.inf)
37 flongdouble = pytest.warns(RuntimeWarning, np.longdouble, '-1e10000')
38 assert_equal(flongdouble, -np.inf)
39
40
41class TestExtraArgs:

Callers

nothing calls this directly

Calls 2

assert_equalFunction · 0.90
doubleMethod · 0.80

Tested by

no test coverage detected