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}')
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
def assert_resoudre(x, y): assertEqual(str(resoudre(x)), y)
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