示例#1
0
def test_issue_230():
    # 3 racines réelles pour le polynôme.
    assertEqual(str(resoudre("x^3+7*x^2-5*x-4==0").evalf()),
            '{-7.58937000406433 ; -0.488827742140880 ; 1.07819774620521}')
示例#2
0
def assert_resoudre(x, y):
    if not isinstance(y, (list, tuple, set)):
        y = [y]
    if not assertEqualAny(str(resoudre(x)), y, _raise=False):
        print(_red('-> Test failed for %s' % repr(x)))
        assert False
示例#3
0
def assert_resoudre(x, y):
    assertEqual(str(resoudre(x)), y)
示例#4
0
def test_poly3():
    sols = resoudre('5 + 1500/x**2 - 2*(1500*x + 100)/x**3=0', ensemble='R')
    # 3 solutions
    assert len(sols.intervalles) == 3