pub fn modulo(x: f64, y: f64) -> f64Expand description
(fmod) Returns the floating-point remainder of x/y
The magnitude of the result is less than y and its sign agrees with that of x
See also: https://cplusplus.com/reference/cmath/fmod/
§Special cases
modulo(±Inf, y) = NaNmodulo(NaN, y) = NaNmodulo(x, 0) = NaNmodulo(x, ±Inf) = xmodulo(x, NaN) = NaN
§Examples
use russell_lab::{approx_eq, math};
approx_eq(math::modulo( 5.3, 2.0), 1.3, 1e-15);
approx_eq(math::modulo(18.5, 4.2), 1.7, 1e-15);