Edit - as Greg and Henry pointed out, there is a better way to do this. you should use that and just look on this post as an explanation of the compiler error.
Greg Charles wrote:That looks right to me. Loss of precision is something you worry about with floating point arithmetic. With integers, you are either wrong or right.
By the way, you don't need Math.floor. Integer division will always truncate off the fractional part.
I understand. But what can I do to skip possible loss of precision error messages?
If it's not clear already, just do away with the Math.floor() call. You don't need it. As Joanne pointed out, the "loss" that the compiler complains about is converting a double returned by Math.floor() to a long (integer) without a cast. However, you have no reason to stray into the world of floating point arithmetic at all. Your integer division minute / 60 in math may yield a number with fractions, but in the computer will yield an integer with the fractional part throw away. Sorry for the confusion!