File tree Expand file tree Collapse file tree 5 files changed +23
-48
lines changed
library/coretests/tests/floats Expand file tree Collapse file tree 5 files changed +23
-48
lines changed Original file line number Diff line number Diff line change @@ -78,19 +78,6 @@ fn test_powi() {
7878 assert_biteq ! ( neg_inf. powi( 2 ) , inf) ;
7979}
8080
81- #[ test]
82- #[ cfg( not( miri) ) ]
83- #[ cfg( target_has_reliable_f128_math) ]
84- fn test_sqrt_domain ( ) {
85- assert ! ( f128:: NAN . sqrt( ) . is_nan( ) ) ;
86- assert ! ( f128:: NEG_INFINITY . sqrt( ) . is_nan( ) ) ;
87- assert ! ( ( -1.0f128 ) . sqrt( ) . is_nan( ) ) ;
88- assert_biteq ! ( ( -0.0f128 ) . sqrt( ) , -0.0 ) ;
89- assert_biteq ! ( 0.0f128 . sqrt( ) , 0.0 ) ;
90- assert_biteq ! ( 1.0f128 . sqrt( ) , 1.0 ) ;
91- assert_biteq ! ( f128:: INFINITY . sqrt( ) , f128:: INFINITY ) ;
92- }
93-
9481#[ test]
9582fn test_to_degrees ( ) {
9683 let pi: f128 = consts:: PI ;
Original file line number Diff line number Diff line change @@ -80,19 +80,6 @@ fn test_powi() {
8080 assert_biteq ! ( neg_inf. powi( 2 ) , inf) ;
8181}
8282
83- #[ test]
84- #[ cfg( not( miri) ) ]
85- #[ cfg( target_has_reliable_f16_math) ]
86- fn test_sqrt_domain ( ) {
87- assert ! ( f16:: NAN . sqrt( ) . is_nan( ) ) ;
88- assert ! ( f16:: NEG_INFINITY . sqrt( ) . is_nan( ) ) ;
89- assert ! ( ( -1.0f16 ) . sqrt( ) . is_nan( ) ) ;
90- assert_biteq ! ( ( -0.0f16 ) . sqrt( ) , -0.0 ) ;
91- assert_biteq ! ( 0.0f16 . sqrt( ) , 0.0 ) ;
92- assert_biteq ! ( 1.0f16 . sqrt( ) , 1.0 ) ;
93- assert_biteq ! ( f16:: INFINITY . sqrt( ) , f16:: INFINITY ) ;
94- }
95-
9683#[ test]
9784fn test_to_degrees ( ) {
9885 let pi: f16 = consts:: PI ;
Original file line number Diff line number Diff line change @@ -60,17 +60,6 @@ fn test_powi() {
6060 assert_biteq ! ( neg_inf. powi( 2 ) , inf) ;
6161}
6262
63- #[ test]
64- fn test_sqrt_domain ( ) {
65- assert ! ( f32 :: NAN . sqrt( ) . is_nan( ) ) ;
66- assert ! ( f32 :: NEG_INFINITY . sqrt( ) . is_nan( ) ) ;
67- assert ! ( ( -1.0f32 ) . sqrt( ) . is_nan( ) ) ;
68- assert_biteq ! ( ( -0.0f32 ) . sqrt( ) , -0.0 ) ;
69- assert_biteq ! ( 0.0f32 . sqrt( ) , 0.0 ) ;
70- assert_biteq ! ( 1.0f32 . sqrt( ) , 1.0 ) ;
71- assert_biteq ! ( f32 :: INFINITY . sqrt( ) , f32 :: INFINITY ) ;
72- }
73-
7463#[ test]
7564fn test_to_degrees ( ) {
7665 let pi: f32 = consts:: PI ;
Original file line number Diff line number Diff line change @@ -55,17 +55,6 @@ fn test_powi() {
5555 assert_biteq ! ( neg_inf. powi( 2 ) , inf) ;
5656}
5757
58- #[ test]
59- fn test_sqrt_domain ( ) {
60- assert ! ( f64 :: NAN . sqrt( ) . is_nan( ) ) ;
61- assert ! ( f64 :: NEG_INFINITY . sqrt( ) . is_nan( ) ) ;
62- assert ! ( ( -1.0f64 ) . sqrt( ) . is_nan( ) ) ;
63- assert_biteq ! ( ( -0.0f64 ) . sqrt( ) , -0.0 ) ;
64- assert_biteq ! ( 0.0f64 . sqrt( ) , 0.0 ) ;
65- assert_biteq ! ( 1.0f64 . sqrt( ) , 1.0 ) ;
66- assert_biteq ! ( f64 :: INFINITY . sqrt( ) , f64 :: INFINITY ) ;
67- }
68-
6958#[ test]
7059fn test_to_degrees ( ) {
7160 let pi: f64 = consts:: PI ;
Original file line number Diff line number Diff line change @@ -1121,3 +1121,26 @@ float_test! {
11211121 assert_biteq!( nan2. next_down( ) , nan2) ;
11221122 }
11231123}
1124+
1125+ // FIXME(f16_f128,miri): many of these have to be disabled since miri does not yet support
1126+ // the intrinsics.
1127+
1128+ float_test ! {
1129+ name: sqrt_domain,
1130+ attrs: {
1131+ const : #[ cfg( false ) ] ,
1132+ f16: #[ cfg( all( not( miri) , target_has_reliable_f16_math) ) ] ,
1133+ f128: #[ cfg( all( not( miri) , target_has_reliable_f128_math) ) ] ,
1134+ } ,
1135+ test<Float > {
1136+ let one: Float = 1.0 ;
1137+ let zero: Float = 0.0 ;
1138+ assert!( Float :: NAN . sqrt( ) . is_nan( ) ) ;
1139+ assert!( Float :: NEG_INFINITY . sqrt( ) . is_nan( ) ) ;
1140+ assert!( ( -one) . sqrt( ) . is_nan( ) ) ;
1141+ assert_biteq!( ( -zero) . sqrt( ) , -zero) ;
1142+ assert_biteq!( zero. sqrt( ) , zero) ;
1143+ assert_biteq!( one. sqrt( ) , one) ;
1144+ assert_biteq!( Float :: INFINITY . sqrt( ) , Float :: INFINITY ) ;
1145+ }
1146+ }
You can’t perform that action at this time.
0 commit comments