Is there a C++ function that allows calculation of floating point modulus?
I don't think there is, so I ask: Is there a faster way to calculate modulus than my example here?
(edit: spelling)Code:double modulus(double left, double right) { double quota = left / right; double frac,tmp; frac = std::modf(quota,&tmp); //frac contains what's beyond the '.' frac *= right; return frac; }