hypot
fn hypot(float a, float b) -> float Import
Source: use num::{hypot}; src/num.hy Returns sqrt(a * a + b * b), the length of the hypotenuse.
Parameters#
| Name | Type |
|---|---|
a | float |
b | float |
Returns#
float
Examples#
use num::{hypot};
use tests::assert;
assert!(hypot(3.0, 4.0) == 5.0);
See also#
abs: Returns the absolute value ofx.min: Returns the smaller ofaandb(awhen they are equal).max: Returns the larger ofaandb(awhen they are equal).round: Roundsxto the nearest whole number; halves round away from zero.clamp: Returnsxlimited to the rangelo..=hi.signum: Returns-1,0or1by the sign ofx.gcd: Returns the greatest common divisor ofaandb, which should be non-negative.lcm: Returns the least common multiple ofaandb, which should be non-negative;0when either is0.