compiler_builtins/math/libm_math/
fmod.rs

1/// Calculate the remainder of `x / y`, the precise result of `x - trunc(x / y) * y`.
2#[cfg(f16_enabled)]
3#[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)]
4pub fn fmodf16(x: f16, y: f16) -> f16 {
5    super::generic::fmod(x, y)
6}
7
8/// Calculate the remainder of `x / y`, the precise result of `x - trunc(x / y) * y`.
9#[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)]
10pub fn fmodf(x: f32, y: f32) -> f32 {
11    super::generic::fmod(x, y)
12}
13
14/// Calculate the remainder of `x / y`, the precise result of `x - trunc(x / y) * y`.
15#[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)]
16pub fn fmod(x: f64, y: f64) -> f64 {
17    super::generic::fmod(x, y)
18}
19
20/// Calculate the remainder of `x / y`, the precise result of `x - trunc(x / y) * y`.
21#[cfg(f128_enabled)]
22#[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)]
23pub fn fmodf128(x: f128, y: f128) -> f128 {
24    super::generic::fmod(x, y)
25}