Integer Division
In Apex Code, similar to Java, when there are two like numeric data types (e.g. both Integers), then they are calculated in a way that returns the same data type. Integers cannot store fractions, so when you do something like 7/3, the fraction is silently discarded. As far as I know, integer division works in the same for every programming language in the world where the result of integer arithmetic is an integer.In many languages where the result of two integers being divided together results in an integer, the fraction is often dropped entirely, although exceptions do exist (some perform rounding, instead).
Parameter Promotion
You'll notice that there's no function Math.ceil that accepts an Integer. This means if you give it an integer, it will implicitly be cast to a floating point value before being processed by Math.ceil.
Arithmetic Promotion
When two numbers are operated on using the standard operators (+, -, /, *), if one of those parameters are a floating point value, the other one will also automatically become a floating point value. Similarly, if a integer and a long were involved in an operation, both numbers become long, and the return type becomes long. So, the goal is to create a situation where a floating point is returned. For example, this results in the correct result:
Integer x = Math.ceil(7.0/3).intValue();
Here, the 7.0 indicates a floating point operation. You'd also get the same effect if you did this:
Decimal x = 7;
Integer y = 3;
Integer z = Math.ceil(x/y).intValue();
This behavior is well-defined, and mimics the behavior in Java. You can read more about automatic widening conversion in the Java documentation, as well as rules about integer division. You'll find that, while not explicitly mentioned in the Apex Code Developer's Guide (as far as I can tell), it obeys the same rules.
Math.ceil(8/5) == 2
, because the following assertion passes for me:system.assertEquals(1, Math.ceil(8/5))