Function au::polynomial::real_quadratic_roots[][src]

pub fn real_quadratic_roots<T: Float>(b: T, c: T) -> Option<(T, T)>

Calculate the real roots of the quadratic equation x^2 + b*x + c = 0.

Arguments

  • b - first degree coefficient
  • c - zero degree coefficient

Example

 use au::polynomial;
 let actual = polynomial::real_quadratic_roots(-2., 1.);
 assert_eq!(Some((1., 1.)), actual);