File tree Expand file tree Collapse file tree 1 file changed +29
-4
lines changed
library/coretests/tests/num Expand file tree Collapse file tree 1 file changed +29
-4
lines changed Original file line number Diff line number Diff line change @@ -891,12 +891,11 @@ macro_rules! test_float {
891
891
// be safely doubled, while j is significantly smaller.
892
892
for i in $max_exp. saturating_sub( 64 ) ..$max_exp {
893
893
for j in 0 ..64u8 {
894
- let large = <$fty> :: from ( 2.0f32 ) . powi( i) ;
894
+ let large = ( 2.0 as $fty ) . powi( i) ;
895
895
// a much smaller number, such that there is no chance of overflow to test
896
896
// potential double rounding in midpoint's implementation.
897
- let small = <$fty>:: from( 2.0f32 ) . powi( $max_exp - 1 )
898
- * <$fty>:: EPSILON
899
- * <$fty>:: from( j) ;
897
+ let small =
898
+ ( 2.0 as $fty) . powi( $max_exp - 1 ) * <$fty>:: EPSILON * <$fty>:: from( j) ;
900
899
901
900
let naive = ( large + small) / 2.0 ;
902
901
let midpoint = large. midpoint( small) ;
@@ -948,6 +947,19 @@ macro_rules! float_const_assert {
948
947
} ;
949
948
}
950
949
950
+ // FIXME(f16_f128): `f16` is only tested in consts for now.
951
+ test_float ! (
952
+ f16_const,
953
+ float_const_assert,
954
+ f16,
955
+ f16:: INFINITY ,
956
+ f16:: NEG_INFINITY ,
957
+ f16:: NAN ,
958
+ f16:: MIN ,
959
+ f16:: MAX ,
960
+ f16:: MIN_POSITIVE ,
961
+ f16:: MAX_EXP
962
+ ) ;
951
963
test_float ! (
952
964
f32 ,
953
965
float_assert,
@@ -996,3 +1008,16 @@ test_float!(
996
1008
f64 :: MIN_POSITIVE ,
997
1009
f64 :: MAX_EXP
998
1010
) ;
1011
+ // FIXME(f16_f128): `f128` is only tested in consts for now.
1012
+ test_float ! (
1013
+ f128_const,
1014
+ float_const_assert,
1015
+ f128,
1016
+ f128:: INFINITY ,
1017
+ f128:: NEG_INFINITY ,
1018
+ f128:: NAN ,
1019
+ f128:: MIN ,
1020
+ f128:: MAX ,
1021
+ f128:: MIN_POSITIVE ,
1022
+ f128:: MAX_EXP
1023
+ ) ;
You can’t perform that action at this time.
0 commit comments