@@ -881,14 +881,29 @@ mod tests {
881
881
882
882
#[ test]
883
883
fn test_subnormals ( ) {
884
- assert ! ( tf64:: MIN_SUBNORMAL_POSITIVE . is_subnormal( ) ) ;
885
- assert ! ( tf64:: MAX_SUBNORMAL_POSITIVE . is_subnormal( ) ) ;
886
- assert ! ( tf64:: MIN_SUBNORMAL_NEGATIVE . is_subnormal( ) ) ;
887
- assert ! ( tf64:: MAX_SUBNORMAL_NEGATIVE . is_subnormal( ) ) ;
888
-
889
- assert ! ( tf32:: MIN_SUBNORMAL_POSITIVE . is_subnormal( ) ) ;
890
- assert ! ( tf32:: MAX_SUBNORMAL_POSITIVE . is_subnormal( ) ) ;
891
- assert ! ( tf32:: MIN_SUBNORMAL_NEGATIVE . is_subnormal( ) ) ;
892
- assert ! ( tf32:: MAX_SUBNORMAL_NEGATIVE . is_subnormal( ) ) ;
884
+ const SUBNORMALS_F64 : [ f64 ; 4 ] = [
885
+ tf64:: MAX_SUBNORMAL_NEGATIVE . get ( ) ,
886
+ tf64:: MIN_SUBNORMAL_NEGATIVE . get ( ) ,
887
+ tf64:: MIN_SUBNORMAL_POSITIVE . get ( ) ,
888
+ tf64:: MAX_SUBNORMAL_POSITIVE . get ( ) ,
889
+ ] ;
890
+
891
+ const SUBNORMALS_F32 : [ f32 ; 4 ] = [
892
+ tf32:: MAX_SUBNORMAL_NEGATIVE . get ( ) ,
893
+ tf32:: MIN_SUBNORMAL_NEGATIVE . get ( ) ,
894
+ tf32:: MIN_SUBNORMAL_POSITIVE . get ( ) ,
895
+ tf32:: MAX_SUBNORMAL_POSITIVE . get ( ) ,
896
+ ] ;
897
+
898
+ assert_sorted ( & SUBNORMALS_F64 , 0.0 ) ;
899
+ assert_sorted ( & SUBNORMALS_F32 , 0.0 ) ;
900
+
901
+ for value in SUBNORMALS_F64 {
902
+ assert ! ( value. is_subnormal( ) ) ;
903
+ }
904
+
905
+ for value in SUBNORMALS_F32 {
906
+ assert ! ( value. is_subnormal( ) ) ;
907
+ }
893
908
}
894
909
}
0 commit comments