Revert "Fix f64 examples"

This reverts commit 576426a05a.
This commit is contained in:
Jacob Kiesel
2017-09-08 16:07:15 -06:00
parent 8b96167004
commit 15d3eeaf65

View File

@@ -971,17 +971,15 @@ impl f64 {
} }
/// Returns max if self is greater than max, and min if self is less than min. /// 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. Panics if min > max, min equals NaN, or max equals NaN.
/// ///
/// # Examples /// # Examples
/// ///
/// ``` /// ```
/// #![feature(clamp)]
/// use std::f64::NAN;
/// assert!((-3.0f64).clamp(-2.0f64, 1.0f64) == -2.0f64); /// assert!((-3.0f64).clamp(-2.0f64, 1.0f64) == -2.0f64);
/// assert!((0.0f64).clamp(-2.0f64, 1.0f64) == 0.0f64); /// assert!((0.0f64).clamp(-2.0f64, 1.0f64) == 0.0f64);
/// assert!((2.0f64).clamp(-2.0f64, 1.0f64) == 1.0f64); /// assert!((2.0f64).clamp(-2.0f64, 1.0f64) == 1.0f64);
/// assert!((NAN).clamp(-2.0f64, 1.0f64).is_nan()); /// assert!((NAN).clamp(-2.0f64, 1.0f64) == NAN);
/// ``` /// ```
#[unstable(feature = "clamp", issue = "44095")] #[unstable(feature = "clamp", issue = "44095")]
#[inline] #[inline]