Skip to main content

hypot

Function hypot 

pub fn hypot(x: f64, y: f64) -> f64
Expand description

sqrt(x^2 + y^2) without undue overflow or underflow, fdlibm’s __ieee754_hypot.

With a >= b the magnitudes, compared by high word: a + b when a is more than 2^60 times b; otherwise both scaled by a power of two when large or tiny, a^2 + b^2 summed from parts with the low 32 bits split off, and the square root scaled back. An infinite argument gives +inf, even with a NaN; otherwise a NaN gives NaN.