Cover edge cases for {f32, f64}.hypot() docs
Re-phrase in a way that handles input values being either 0 or negative.
This commit is contained in:
parent
e4dae0dac7
commit
cd868dcf98
2 changed files with 8 additions and 4 deletions
|
@ -583,8 +583,10 @@ impl f64 {
|
|||
unsafe { cmath::cbrt(self) }
|
||||
}
|
||||
|
||||
/// Calculates the length of the hypotenuse of a right-angle triangle given
|
||||
/// legs of length `x` and `y`.
|
||||
/// Compute the distance between the origin and a point (`x`, `y`) on the
|
||||
/// Euclidean plane. Equivalently, compute the length of the hypotenuse of a
|
||||
/// right-angle triangle with other sides having length `x.abs()` and
|
||||
/// `y.abs()`.
|
||||
///
|
||||
/// # Examples
|
||||
///
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue