Function sign_root

Source
pub fn sign_root<T: Arith>(a: &T, b: &T, c: &T) -> Option<Sign>
Expand description

Sign of a + b*sqrt(c) for c >= 0.

If a and b*sqrt(c) agree in sign (or one is zero), that is the answer. If they disagree, the larger magnitude wins, and comparing magnitudes is comparing squares: the result is sign(a) * sign(a^2 - b^2*c). An exact zero comes out when they cancel exactly.

Returns None when T cannot decide, or when c is negative (the value is not real).