aboutsummaryrefslogtreecommitdiff
path: root/tests/cast.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/cast.rs')
-rw-r--r--tests/cast.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/tests/cast.rs b/tests/cast.rs
index b3f3108..69310d0 100644
--- a/tests/cast.rs
+++ b/tests/cast.rs
@@ -24,7 +24,8 @@ use core::num::Wrapping;
#[test]
fn to_primitive_float() {
let f32_toolarge = 1e39f64;
- assert_eq!(f32_toolarge.to_f32(), None);
+ assert_eq!(f32_toolarge.to_f32(), Some(f32::INFINITY));
+ assert_eq!((-f32_toolarge).to_f32(), Some(f32::NEG_INFINITY));
assert_eq!((f32::MAX as f64).to_f32(), Some(f32::MAX));
assert_eq!((-f32::MAX as f64).to_f32(), Some(-f32::MAX));
assert_eq!(f64::INFINITY.to_f32(), Some(f32::INFINITY));