Skip to main content

solve_quadratic

Function solve_quadratic 

Source
pub fn solve_quadratic(a: f64, b: f64, c: f64) -> Roots
Expand description

Solves the quadratic equation ax^2 + bx + c = 0 over the real numbers.

When a == 0.0, this falls back to solving bx + c = 0 with solve_linear. Roots are returned in ascending order when two distinct real roots exist.