为什么算出来的结果错误
import math
def quadratic_equation(a, b, c):
x=-b/(2*a)+math.sqrt(b*b-4*a*c)/(2*a)
y=-b/(2*a)-math.sqrt(b*b-4*a*c)/(2*a)
return x,y
print quadratic_equation(2, 3, 0)
print quadratic_equation(1, -6, 5)
import math
def quadratic_equation(a, b, c):
x=-b/(2*a)+math.sqrt(b*b-4*a*c)/(2*a)
y=-b/(2*a)-math.sqrt(b*b-4*a*c)/(2*a)
return x,y
print quadratic_equation(2, 3, 0)
print quadratic_equation(1, -6, 5)
2018-06-28
举报