Oh I'm sorry I was looking at the wrong line (been coding too long of course!).

Actually the warning was about another line so that's why casting the result of the division didn't help anything.

I'm very thankful though for your explanation, it helped me understand errors of the same type that I had for some of my other programs.