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() {
78
78
assert_biteq ! ( neg_inf. powi( 2 ) , inf) ;
79
79
}
80
80
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
-
94
81
#[ test]
95
82
fn test_to_degrees ( ) {
96
83
let pi: f128 = consts:: PI ;
Original file line number Diff line number Diff line change @@ -80,19 +80,6 @@ fn test_powi() {
80
80
assert_biteq ! ( neg_inf. powi( 2 ) , inf) ;
81
81
}
82
82
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
-
96
83
#[ test]
97
84
fn test_to_degrees ( ) {
98
85
let pi: f16 = consts:: PI ;
Original file line number Diff line number Diff line change @@ -60,17 +60,6 @@ fn test_powi() {
60
60
assert_biteq ! ( neg_inf. powi( 2 ) , inf) ;
61
61
}
62
62
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
-
74
63
#[ test]
75
64
fn test_to_degrees ( ) {
76
65
let pi: f32 = consts:: PI ;
Original file line number Diff line number Diff line change @@ -55,17 +55,6 @@ fn test_powi() {
55
55
assert_biteq ! ( neg_inf. powi( 2 ) , inf) ;
56
56
}
57
57
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
-
69
58
#[ test]
70
59
fn test_to_degrees ( ) {
71
60
let pi: f64 = consts:: PI ;
Original file line number Diff line number Diff line change @@ -1121,3 +1121,26 @@ float_test! {
1121
1121
assert_biteq!( nan2. next_down( ) , nan2) ;
1122
1122
}
1123
1123
}
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