JVM Knowledge

i2l

Raw .md Oracle

Operation

Convert int to long

Format

i2l

Forms

i2l = 133 (0x85)

Operand Stack

..., value →

..., result

Description

The value on the top of the operand stack must be of type int. It is popped from the operand stack and sign-extended to a long result. The result is pushed onto the operand stack.

Notes

The i2l instruction performs a widening primitive conversion (JLS §5.1.2). Because all values of type int are exactly representable by type long, the conversion is exact.