3 ms·
Not easily, and not in 70 lines. But there's the Python library "sympy" which can do symbolic algebraic equation solving (and many other things): from symp
by lutusp 14y ago
Not easily, and not in 70 lines. But there's the Python library "sympy" which can do symbolic algebraic equation solving (and many other things):
from sympy import *
var('x,b,c')
print solve(a*x**2+b*x+c,x)
Result:
[(-b + (-4*a*c + b**2)**(1/2))/(2*a), -(b + (-4*a*c + b**2)**(1/2))/(2*a)]