JVM Knowledge

imul

Raw .md Oracle

Operation

Multiply int

Format

imul

Forms

imul = 104 (0x68)

Operand Stack

..., value1, value2 →

..., result

Description

Both value1 and value2 must be of type int. The values are popped from the operand stack. The int result is value1 * value2. The result is pushed onto the operand stack.

The result is the 32 low-order bits of the true mathematical result in a sufficiently wide two's-complement format, represented as a value of type int. If overflow occurs, then the sign of the result may not be the same as the sign of the mathematical multiplication of the two values.

Despite the fact that overflow may occur, execution of an imul instruction never throws a run-time exception.