Skip to main content

hypot

Function hypot 

Source
pub const fn hypot(x: Real, y: Real) -> Real
Expand description

Computes sqrt(x² + y²) without overflow or harmful underflow.

A const fn-compatible port of the musl hypot implementation. Returns |x| when y is zero, and follows IEEE special-case rules (e.g. hypot(±∞, NaN) returns +∞).