File tree 1 file changed +4
-2
lines changed
1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -1081,15 +1081,17 @@ impl f32 {
1081
1081
}
1082
1082
1083
1083
/// Returns max if self is greater than max, and min if self is less than min.
1084
- /// Otherwise this returns self. Panics if min > max, min equals NaN, or max equals NaN.
1084
+ /// Otherwise this returns self. Panics if min > max, min is NaN, or max is NaN.
1085
1085
///
1086
1086
/// # Examples
1087
1087
///
1088
1088
/// ```
1089
+ /// #![feature(clamp)]
1090
+ /// use std::f32::NAN;
1089
1091
/// assert!((-3.0f32).clamp(-2.0f32, 1.0f32) == -2.0f32);
1090
1092
/// assert!((0.0f32).clamp(-2.0f32, 1.0f32) == 0.0f32);
1091
1093
/// assert!((2.0f32).clamp(-2.0f32, 1.0f32) == 1.0f32);
1092
- /// assert!((NAN).clamp(-2.0f32, 1.0f32) == NAN );
1094
+ /// assert!((NAN).clamp(-2.0f32, 1.0f32).is_nan() );
1093
1095
/// ```
1094
1096
#[ unstable( feature = "clamp" , issue = "44095" ) ]
1095
1097
#[ inline]
You can’t perform that action at this time.
0 commit comments