Quote:
Originally Posted by TimCraig
time = (int) (1000L * degrees / 300);
|
It might be better to simplify that further using some algebra to something like
Code:
time = (int)((long)10 * (long)degrees / (long)3)
That way, you won't run into interger or long overflow problems until degrees is 100 times as large as it would have had to be earlier.