Returns the non-negative remainder of x / m.
x
m
static double mod(double x, double m) => ((x % m) + m) % m;