you could try leaving out the modulus operator until the very end.
What i mean is:
Do all the calculations without the modulus first.
Convert that answer into an int
Do the calculation involving the modulus
There are several problems with your code. First since floor() returns a double you are mixing floating point and integer math. You don't need floor() since by design integer math truncates any fractional parts, there are no fractions in integer math. So I recommend just using integer math, but always remember that there are no fractions 2010 / 100 will yield 20, and 1 / 5 will yield zero.
Your error is being caused by the use of the floor() it makes the equation into a floating point value, and you can't use the modulus operator on floating point numbers.