This is due to the inaccuracies of floating point. The division is probably getting something like 9.9999988..., and that would display as 10 as a float but it would be truncated when converted to an int.
@MatrixZ
mark it as solved, so that other people, which will try to help, won't get in, while people looking for an answer will know the answer is available.