pub fn true_mod(a: f64, b: f64) -> f64Expand description
True modulo: result has the sign of the divisor (unlike Rust’s %); 0.0 on division by zero.
use wowlab_types::numeric::true_mod;
assert_eq!(true_mod(7.0, 3.0), 1.0);
assert_eq!(true_mod(-7.0, 3.0), 2.0);
assert_eq!(true_mod(7.0, -3.0), -2.0);
assert_eq!(true_mod(-7.0, -3.0), -1.0);
assert_eq!(true_mod(5.0, 0.0), 0.0);