JAVA is not, so data processing is different.
You must divide two integer data.
Int type is integer data, and only integers can be saved.
If you divide two floating-point or double-precision data, the situation is different.
Will be equal to 0.5.
============================
The problem of complement, that is the compiler's business, don't worry about it.
The reason why high-level languages are invented is to liberate programmers from tedious assembly code.
That's the compiler's business.