Skip to content

Commit 66c2e38

Browse files
committed
Separate f128 % operation to deal with missing fmodl symbol
1 parent 546a1ea commit 66c2e38

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

library/std/src/f128/tests.rs

+15-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,21 @@ macro_rules! assert_f128_biteq {
5353

5454
#[test]
5555
fn test_num_f128() {
56-
test_num(10f128, 2f128);
56+
// FIXME(f16_f128): replace with a `test_num` call once the required `fmodl`/`fmodf128` function is available on all platforms.
57+
let ten = 10f128;
58+
let two = 2f128;
59+
assert_eq!(ten.add(two), ten + two);
60+
assert_eq!(ten.sub(two), ten - two);
61+
assert_eq!(ten.mul(two), ten * two);
62+
assert_eq!(ten.div(two), ten / two);
63+
}
64+
65+
#[test]
66+
#[cfg(reliable_f128_math)]
67+
fn test_num_f128_rem() {
68+
let ten = 10f128;
69+
let two = 2f128;
70+
assert_eq!(ten.rem(two), ten % two);
5771
}
5872

5973
#[test]

0 commit comments

Comments
 (0)