Skip to main content

Module hypot

Module hypot 

Source
Expand description

Hypot and HypotAssign, traits for computing the hypotenuse of two numbers, $\sqrt{x^2+y^2}$.

§hypot

use core::f64::consts::{E, PI};
use malachite_base::num::arithmetic::traits::Hypot;
use malachite_float::Float;

assert_eq!(
    Float::from(PI).hypot(Float::from(E)).to_string(),
    "4.1543544023133130"
);

Functions§

primitive_float_hypot
Computes the hypotenuse of two primitive floats, $\sqrt{x^2+y^2}$, with a single rounding.