]> git.lizzy.rs Git - rust.git/commitdiff
Fix f32 examples.
authorJacob Kiesel <kieseljake@gmail.com>
Sat, 26 Aug 2017 23:53:01 +0000 (17:53 -0600)
committerGitHub <noreply@github.com>
Sat, 26 Aug 2017 23:53:01 +0000 (17:53 -0600)
src/libstd/f32.rs

index cef53671e806ca27b2ce25d3f7ece8681df2db6e..6b6bd39e7e84ccf63d2a48aeeb6e69cccb01bfaa 100644 (file)
@@ -1081,15 +1081,17 @@ pub fn atanh(self) -> 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 equals NaN, or max equals NaN.
+    /// Otherwise this returns self.  Panics if min > max, min is NaN, or max is NaN.
     ///
     /// # Examples
     ///
     /// ```
+    /// #![feature(clamp)]
+    /// use std::f32::NAN;
     /// assert!((-3.0f32).clamp(-2.0f32, 1.0f32) == -2.0f32);
     /// assert!((0.0f32).clamp(-2.0f32, 1.0f32) == 0.0f32);
     /// assert!((2.0f32).clamp(-2.0f32, 1.0f32) == 1.0f32);
-    /// assert!((NAN).clamp(-2.0f32, 1.0f32) == NAN);
+    /// assert!((NAN).clamp(-2.0f32, 1.0f32).is_nan());
     /// ```
     #[unstable(feature = "clamp", issue = "44095")]
     #[inline]