Fix documentation and formatting.

This commit is contained in:
Jacob Kiesel
2017-09-01 00:07:26 -06:00
parent 576426a05a
commit 2e34ff7671
3 changed files with 15 additions and 11 deletions

View File

@@ -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 {

View File

@@ -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 {