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

Method test_str

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

Source from the content-addressed store, hash-verified

515 poly.set_default_printstyle('ascii')
516
517 def test_str(self):
518 p = poly.Polynomial([1 / 2, 1 / 7, 1 / 7 * 10**8, 1 / 7 * 10**9])
519 assert_equal(str(p), '0.5 + 0.14285714 x + 14285714.28571429 x**2 '
520 '+ (1.42857143e+08) x**3')
521
522 with printoptions(precision=3):
523 assert_equal(str(p), '0.5 + 0.143 x + 14285714.286 x**2 '
524 '+ (1.429e+08) x**3')
525
526 def test_latex(self):
527 p = poly.Polynomial([1 / 2, 1 / 7, 1 / 7 * 10**8, 1 / 7 * 10**9])

Callers

nothing calls this directly

Calls 2

assert_equalFunction · 0.90
printoptionsFunction · 0.90

Tested by

no test coverage detected