Var root_part Mathsqrt b b - 4 a c. Solving a quadratic equation with a discriminant that is less than 0 will return an empty array. Read a b c.
Return result result2.
Standard form of quadratic equation is ax 2 bx c where a b and c are coefficient and real numbers and also a 0. Excellent reference material for JavaScript. This is a free javascript calculator. Function solve abc var result -1b Mathsqrt Mathpow b2 - 4ac 2a.