Skip to main content

deep_time/math/
div.rs

1use crate::Real;
2
3/// const friendly rem euclid function for float.
4pub const fn rem_euclid_f(lhs: Real, rhs: Real) -> Real {
5    let r = lhs % rhs;
6    if r < f!(0.0) {
7        if rhs > f!(0.0) { r + rhs } else { r - rhs }
8    } else {
9        r
10    }
11}