diff options
| author | Jacob Kiesel <kieseljake@gmail.com> | 2017-08-26 17:54:51 -0600 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-08-26 17:54:51 -0600 |
| commit | 576426a05a1a6cb33eece7082d7341b7c6bb5277 (patch) | |
| tree | 8827cacc02b3dd85dc52f319ae32e1986abe6695 /src/libstd | |
| parent | 61f20f8df02e53ee60dc1719ce0e502eecebf8b4 (diff) | |
| download | rust-576426a05a1a6cb33eece7082d7341b7c6bb5277.tar.gz rust-576426a05a1a6cb33eece7082d7341b7c6bb5277.zip | |
Fix f64 examples
Diffstat (limited to 'src/libstd')
| -rw-r--r-- | src/libstd/f64.rs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/libstd/f64.rs b/src/libstd/f64.rs index ab8f2cd2fdf..0a7176f9cc7 100644 --- a/src/libstd/f64.rs +++ b/src/libstd/f64.rs @@ -971,15 +971,17 @@ 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 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::f64::NAN; /// assert!((-3.0f64).clamp(-2.0f64, 1.0f64) == -2.0f64); /// assert!((0.0f64).clamp(-2.0f64, 1.0f64) == 0.0f64); /// assert!((2.0f64).clamp(-2.0f64, 1.0f64) == 1.0f64); - /// assert!((NAN).clamp(-2.0f64, 1.0f64) == NAN); + /// assert!((NAN).clamp(-2.0f64, 1.0f64).is_nan()); /// ``` #[unstable(feature = "clamp", issue = "44095")] #[inline] |
