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

Method test_str

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

Source from the content-addressed store, hash-verified

483 poly.set_default_printstyle('ascii')
484
485 def test_str(self):
486 p = poly.Polynomial([1/2, 1/7, 1/7*10**8, 1/7*10**9])
487 assert_equal(str(p), '0.5 + 0.14285714 x + 14285714.28571429 x**2 '
488 '+ (1.42857143e+08) x**3')
489
490 with printoptions(precision=3):
491 assert_equal(str(p), '0.5 + 0.143 x + 14285714.286 x**2 '
492 '+ (1.429e+08) x**3')
493
494 def test_latex(self):
495 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