irem is the logical int remainder operator. The Java Virtual Machine Specification writes :
Runtime exception
If the divisor value for the remainder operator intis 0, iremthrows ArithmeticException.
How JVM implementation is implemented that is not specified. It can instruct the processor to compare the divisor to zero before doing the division, or to do the division and react to the fact that the CPU in question indicates that division by 0. Since division by zero is probably rare, the last strategy is probably more effective.
For example, the Intel 64 and IA-32 Architecture Software Developer's Guide , combined volumes 3A, 3B, and 3C: System Programming Guide, writes:
6.1
, , . , , . Pentium 4, Intel Xeon, P6 Pentium .
, , ha ndler. , . , .
, JVM , -.