diff options
| author | Jacob Kiesel <kieseljake@gmail.com> | 2017-08-26 17:53:01 -0600 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-08-26 17:53:01 -0600 |
| commit | 61f20f8df02e53ee60dc1719ce0e502eecebf8b4 (patch) | |
| tree | f02d8ea7a648e1b0e6755451b0e9a266cb583952 /src/libstd | |
| parent | f74c5d2e18e50c24de2cc1192bf2088cdaa61916 (diff) | |
| download | rust-61f20f8df02e53ee60dc1719ce0e502eecebf8b4.tar.gz rust-61f20f8df02e53ee60dc1719ce0e502eecebf8b4.zip | |
Fix f32 examples.
Diffstat (limited to 'src/libstd')
| -rw-r--r-- | src/libstd/f32.rs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/libstd/f32.rs b/src/libstd/f32.rs index cef53671e80..6b6bd39e7e8 100644 --- a/src/libstd/f32.rs +++ b/src/libstd/f32.rs @@ -1081,15 +1081,17 @@ 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 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] |
