File tree Expand file tree Collapse file tree 1 file changed +17
-2
lines changed Expand file tree Collapse file tree 1 file changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -219,10 +219,25 @@ mod test {
219
219
220
220
// More tests for special float values
221
221
222
+ #[ test]
223
+ fn test_float_tiny_plus_tiny ( ) {
224
+ let tiny = <f32 as Float >:: from_repr ( 1 ) ;
225
+ let r = super :: __addsf3 ( tiny, tiny) ;
226
+ assert_eq ! ( r, tiny + tiny) ;
227
+ }
228
+
229
+ #[ test]
230
+ fn test_float_small_plus_small ( ) {
231
+ let a = <f32 as Float >:: from_repr ( 327 ) ;
232
+ let b = <f32 as Float >:: from_repr ( 256 ) ;
233
+ let r = super :: __addsf3 ( a, b) ;
234
+ assert_eq ! ( r, a + b) ;
235
+ }
236
+
222
237
#[ test]
223
238
fn test_float_one_plus_one ( ) {
224
- let r = super :: __addsf3 ( < f32 as Float > :: from_repr ( 1 ) , < f32 as Float > :: from_repr ( 1 ) ) ;
225
- assert_eq ! ( r, < f32 as Float > :: from_repr ( 1 ) + < f32 as Float > :: from_repr ( 1 ) ) ;
239
+ let r = super :: __addsf3 ( 1f32 , 1f32 ) ;
240
+ assert_eq ! ( r, 1f32 + 1f32 ) ;
226
241
}
227
242
228
243
#[ test]
You can’t perform that action at this time.
0 commit comments