Seems quite a strange behaviour, but only when there are implicit conversions between units. If you divide two doubles all works well:
a = ceil (901.0 / 900.0) => a = 2.00000000 both in case a is a double or an int
The same result using a = ceil ((double)901 / (double)900)
But when you use two integers, seems as if the result is implicitly cast to an integer before being passed to ceil function, so the wrong result:
a = ceil (901 / 900) => a = 1 again the same in case a is a double or an int
as if the statement executed were: a = ceil ( (int)(901 / 900) )
Infact, ceil (1799 / 900) gives 1 while ceil (1800 / 900) gives 2.
I don't know if this is the right explanation but is seems to explain this behaviour and gives you a practical solution to it.