예제 #1
0
def test_roots_rational():
    assert roots_rational(Poly(x**2-1, x)) == [-S.One, S.One]
    assert roots_rational(Poly(x**2-x, x)) == [S.Zero, S.One]

    assert roots_rational(Poly(x**2-x/2, x)) == [S.Zero]
    assert roots_rational(Poly(2*x**2-x, x)) == [S.Zero]

    assert roots_rational(Poly(t*x**2-x, x)) == []
예제 #2
0
def test_roots_rational():
    assert roots_rational(Poly(x**2 - 1, x)) == [-S.One, S.One]
    assert roots_rational(Poly(x**2 - x, x)) == [S.Zero, S.One]

    assert roots_rational(Poly(x**2 - x / 2, x)) == [S.Zero]
    assert roots_rational(Poly(2 * x**2 - x, x)) == [S.Zero]

    assert roots_rational(Poly(t * x**2 - x, x)) == []