Skip to content

Commit

Permalink
Separate f128 % operation to deal with missing fmodl symbol
Browse files Browse the repository at this point in the history
  • Loading branch information
raoulstrackx committed Nov 7, 2024
1 parent 546a1ea commit 66c2e38
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion library/std/src/f128/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,21 @@ macro_rules! assert_f128_biteq {

#[test]
fn test_num_f128() {
test_num(10f128, 2f128);
// FIXME(f16_f128): replace with a `test_num` call once the required `fmodl`/`fmodf128` function is available on all platforms.
let ten = 10f128;
let two = 2f128;
assert_eq!(ten.add(two), ten + two);
assert_eq!(ten.sub(two), ten - two);
assert_eq!(ten.mul(two), ten * two);
assert_eq!(ten.div(two), ten / two);
}

#[test]
#[cfg(reliable_f128_math)]
fn test_num_f128_rem() {
let ten = 10f128;
let two = 2f128;
assert_eq!(ten.rem(two), ten % two);
}

#[test]
Expand Down

0 comments on commit 66c2e38

Please sign in to comment.