Fix documentation and formatting.
This commit is contained in:
@@ -1081,7 +1081,7 @@ impl f32 {
|
||||
}
|
||||
|
||||
/// Returns max if self is greater than max, and min if self is less than min.
|
||||
/// Otherwise this returns self. Panics if min > max, min is NaN, or max is NaN.
|
||||
/// Otherwise this returns self.
|
||||
///
|
||||
/// # Examples
|
||||
///
|
||||
@@ -1093,6 +1093,9 @@ impl f32 {
|
||||
/// assert!((2.0f32).clamp(-2.0f32, 1.0f32) == 1.0f32);
|
||||
/// assert!((NAN).clamp(-2.0f32, 1.0f32).is_nan());
|
||||
/// ```
|
||||
///
|
||||
/// # Panics
|
||||
/// Panics if min > max, min is NaN, or max is NaN.
|
||||
#[unstable(feature = "clamp", issue = "44095")]
|
||||
#[inline]
|
||||
pub fn clamp(self, min: f32, max: f32) -> f32 {
|
||||
|
||||
@@ -971,7 +971,7 @@ impl f64 {
|
||||
}
|
||||
|
||||
/// Returns max if self is greater than max, and min if self is less than min.
|
||||
/// Otherwise this returns self. Panics if min > max, min is NaN, or max is NaN.
|
||||
/// Otherwise this returns self.
|
||||
///
|
||||
/// # Examples
|
||||
///
|
||||
@@ -983,6 +983,9 @@ impl f64 {
|
||||
/// assert!((2.0f64).clamp(-2.0f64, 1.0f64) == 1.0f64);
|
||||
/// assert!((NAN).clamp(-2.0f64, 1.0f64).is_nan());
|
||||
/// ```
|
||||
///
|
||||
/// # Panics
|
||||
/// Panics if min > max, min is NaN, or max is NaN.
|
||||
#[unstable(feature = "clamp", issue = "44095")]
|
||||
#[inline]
|
||||
pub fn clamp(self, min: f64, max: f64) -> f64 {
|
||||
|
||||
Reference in New Issue
Block a user