Add NaN preserving test for clamp
This commit is contained in:
parent
f20d74fce8
commit
2fb8a6e8a9
|
@ -418,6 +418,7 @@ fn clamp_test() {
|
||||||
assert_eq!(-1.0, clamp_lower(-2.0, -1.0));
|
assert_eq!(-1.0, clamp_lower(-2.0, -1.0));
|
||||||
assert_eq!(-1.0, clamp_upper(1.0, -1.0));
|
assert_eq!(-1.0, clamp_upper(1.0, -1.0));
|
||||||
assert_eq!(-2.0, clamp_upper(-2.0, -1.0));
|
assert_eq!(-2.0, clamp_upper(-2.0, -1.0));
|
||||||
|
assert!(clamp(::core::f32::NAN, -1.0, 1.0).is_nan());
|
||||||
assert!(clamp_lower(::core::f32::NAN, 1.0).is_nan());
|
assert!(clamp_lower(::core::f32::NAN, 1.0).is_nan());
|
||||||
assert!(clamp_upper(::core::f32::NAN, 1.0).is_nan());
|
assert!(clamp_upper(::core::f32::NAN, 1.0).is_nan());
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue