MCPcopy Create free account
hub / github.com/numpy/numpy / test_switch_to_exp

Method test_switch_to_exp

numpy/polynomial/tests/test_printing.py:548–553  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

546 assert_equal(str(p), '0.5000')
547
548 def test_switch_to_exp(self):
549 for i, s in enumerate(SWITCH_TO_EXP):
550 with printoptions(precision=i):
551 p = poly.Polynomial([1.23456789 * 10**-i
552 for i in range(i // 2 + 3)])
553 assert str(p).replace('\n', ' ') == s
554
555 def test_non_finite(self):
556 p = poly.Polynomial([nan, inf])

Callers

nothing calls this directly

Calls 2

printoptionsFunction · 0.90
replaceMethod · 0.80

Tested by

no test coverage detected