1 file changed +20
-2
lines changed Original file line number Diff line number Diff line change 2
2
#![ cfg( reliable_f128) ]
3
3
4
4
use crate :: f128:: consts;
5
- use crate :: num:: { FpCategory as Fp , * } ;
5
+ use crate :: num:: FpCategory as Fp ;
6
+ #[ cfg( reliable_f128_math) ]
7
+ use crate :: ops:: Rem ;
8
+ use crate :: ops:: { Add , Div , Mul , Sub } ;
6
9
7
10
// Note these tolerances make sense around zero, but not for more extreme exponents.
8
11
@@ -53,7 +56,22 @@ macro_rules! assert_f128_biteq {
53
56
54
57
#[ test]
55
58
fn test_num_f128 ( ) {
56
- test_num ( 10 f128, 2 f128) ;
59
+ // FIXME(f16_f128): replace with a `test_num` call once the required `fmodl`/`fmodf128`
60
+ // function is available on all platforms.
61
+ let ten = 10 f128;
62
+ let two = 2 f128;
63
+ assert_eq ! ( ten. add( two) , ten + two) ;
64
+ assert_eq ! ( ten. sub( two) , ten - two) ;
65
+ assert_eq ! ( ten. mul( two) , ten * two) ;
66
+ assert_eq ! ( ten. div( two) , ten / two) ;
67
+ }
68
+
69
+ #[ test]
70
+ #[ cfg( reliable_f128_math) ]
71
+ fn test_num_f128_rem ( ) {
72
+ let ten = 10 f128;
73
+ let two = 2 f128;
74
+ assert_eq ! ( ten. rem( two) , ten % two) ;
57
75
}
58
76
59
77
#[ test]
0 commit comments