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

Method test_as_numer_denom

numpy/f2py/tests/test_symbolic.py:470–481  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

468 pytest.raises(RuntimeError, lambda: (x * x).linear_solve(x))
469
470 def test_as_numer_denom(self):
471 x = as_symbol("x")
472 y = as_symbol("y")
473 n = as_number(123)
474
475 assert as_numer_denom(x) == (x, as_number(1))
476 assert as_numer_denom(x / n) == (x, n)
477 assert as_numer_denom(n / x) == (n, x)
478 assert as_numer_denom(x / y) == (x, y)
479 assert as_numer_denom(x * y) == (x * y, as_number(1))
480 assert as_numer_denom(n + x / y) == (x + n * y, y)
481 assert as_numer_denom(n + x / (y - x / n)) == (y * n**2, y * n - x)
482
483 def test_polynomial_atoms(self):
484 x = as_symbol("x")

Callers

nothing calls this directly

Calls 3

as_symbolFunction · 0.90
as_numberFunction · 0.90
as_numer_denomFunction · 0.90

Tested by

no test coverage detected