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

Method test_latex

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

Source from the content-addressed store, hash-verified

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])
496 assert_equal(p._repr_latex_(),
497 r'$x \mapsto \text{0.5} + \text{0.14285714}\,x + '
498 r'\text{14285714.28571429}\,x^{2} + '
499 r'\text{(1.42857143e+08)}\,x^{3}$')
500
501 with printoptions(precision=3):
502 assert_equal(p._repr_latex_(),
503 r'$x \mapsto \text{0.5} + \text{0.143}\,x + '
504 r'\text{14285714.286}\,x^{2} + \text{(1.429e+08)}\,x^{3}$')
505
506 def test_fixed(self):
507 p = poly.Polynomial([1/2])

Callers

nothing calls this directly

Calls 3

assert_equalFunction · 0.90
printoptionsFunction · 0.90
_repr_latex_Method · 0.80

Tested by

no test coverage detected