Add NAN examples

This commit is contained in:
Jacob Kiesel
2017-08-26 10:36:14 -06:00
parent c589f867f8
commit f74c5d2e18
2 changed files with 2 additions and 0 deletions

View File

@@ -1089,6 +1089,7 @@ impl f32 {
/// 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);
/// ```
#[unstable(feature = "clamp", issue = "44095")]
#[inline]

View File

@@ -979,6 +979,7 @@ impl f64 {
/// 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);
/// ```
#[unstable(feature = "clamp", issue = "44095")]
#[inline]