Skip to main content

hypot2

Function hypot2 

Source
pub fn hypot2<T: Real>(a: T, b: T) -> T
Expand description

Overflow-safe sqrt(a^2 + b^2), generic over reals.

ยงExamples

use mathverse_core::ops::hypot2;

assert_eq!(hypot2(3.0, 4.0), 5.0);
assert_eq!(hypot2(0.0, 0.0), 0.0);