My understanding is that when you divide an integer by an integer, it will always result in an integer. So when you divide 7/3, it's actually returning 2, which is why the Math.ceil() function is returning 2.
Try doing 7Math.ceil(7.0/3.0)
Or you can use code such as:
Double seven = 7.0;
Double three = 3.0;
Integer pageNumber = (Integer)Math.ceil(seven/three);
BTW, the Math.ceil(8/5)
should be returning 1, not 2.0/3
Does anyone know where in the documentation it talks about this? I couldn't find anything.0