Consider this:
double x,y; x =120.0; y = 0.05; double z= x % y;
I tried this and expected the result to be 0, but it came out 0.04933333.<
Modulus should only be used with integer. The remainder come from an euclidean division. With double, you can have unexpected results.
See this article