Convert long
to int
Bytecode
Type | Description |
u1 | l2i opcode = 0x88 (136) |
Stack ..., value.word1, value.word2 => ..., result
Description
The value on the top of the operand stack must be of type long
. It is
popped from the operand stack and converted to an int
result by taking
the low-order 32 bits of the long
value and discarding the high-order 32
bits. The result is pushed onto the operand stack.
Notes
The l2i instruction performs a narrowing primitive conversion.
It may lose information about the overall magnitude of value. The result may
also not have the same sign as value.