static double frac_nonNeg(double d) { ret mod(d, 1); }