File tree 1 file changed +10
-0
lines changed
1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -168,6 +168,16 @@ fn basic() {
168
168
let x: u32 = unsafe { std:: mem:: transmute ( 42.0_f32 ) } ;
169
169
let y: f32 = unsafe { std:: mem:: transmute ( x) } ;
170
170
assert_eq ( y, 42.0_f32 ) ;
171
+
172
+ // `%` sign behavior, some of this used to be buggy
173
+ assert ! ( ( black_box( 1.0f32 ) % 1.0 ) . is_sign_positive( ) ) ;
174
+ assert ! ( ( black_box( 1.0f32 ) % -1.0 ) . is_sign_positive( ) ) ;
175
+ assert ! ( ( black_box( -1.0f32 ) % 1.0 ) . is_sign_negative( ) ) ;
176
+ assert ! ( ( black_box( -1.0f32 ) % -1.0 ) . is_sign_negative( ) ) ;
177
+ assert ! ( ( black_box( 1.0f64 ) % 1.0 ) . is_sign_positive( ) ) ;
178
+ assert ! ( ( black_box( 1.0f64 ) % -1.0 ) . is_sign_positive( ) ) ;
179
+ assert ! ( ( black_box( -1.0f64 ) % 1.0 ) . is_sign_negative( ) ) ;
180
+ assert ! ( ( black_box( -1.0f64 ) % -1.0 ) . is_sign_negative( ) ) ;
171
181
}
172
182
173
183
/// Many of these test values are taken from
You can’t perform that action at this time.
0 commit comments