mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-27 17:24:06 +00:00
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
@ -581,8 +581,10 @@ impl f32 {
|
||||
unsafe { cmath::cbrtf(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
|
||||
///
|
||||
|
@ -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…
Reference in New Issue
Block a user