diff options
author | Haibo Huang <hhb@google.com> | 2020-10-29 19:19:23 -0700 |
---|---|---|
committer | Haibo Huang <hhb@google.com> | 2020-10-29 19:19:23 -0700 |
commit | fa1e128f8d76fc7692bba478999d4b70b0b566ad (patch) | |
tree | cc76fcd4bb0aa6f23ddd864e255ab5d995b4e572 /tests | |
parent | acc09beccc655abcc141a28ad448b8b8a0544f26 (diff) | |
download | num-traits-fa1e128f8d76fc7692bba478999d4b70b0b566ad.tar.gz |
Upgrade rust/crates/num-traits to 0.2.14
Test: make
Change-Id: I65d209f9bebc2dcbb3d3ad95390afd6dae2f17b7
Diffstat (limited to 'tests')
-rw-r--r-- | tests/cast.rs | 3 |
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)); |