before asking question I would like to let you all know that I did see some similar questions from past posts but when applied, won't quite work as intended... So basically, I want to ceil round an integer to a multiple of 60. As an example, if a number that I want to ceil round is 160 to a multiple of 60, the result should yield 180; (because out of 60->120->180; 160 is closest to 180 than 120); my test code looks like this:
public static void main (String[] args) {
double a = Math.ceil(160/60)*60;
System.out.println(a);
}
and the output that it gives is 120.0; instead of 180.
What exactly is wrong with the test code for it to yield 120 rather than 180? Am I using the ceil() wrongly?