f2l

Convert float to long

Bytecode

Type Description
u1 f2l opcode = 0x8C (140)

Stack ..., value => ..., result.word1, result.word2

Description

This is used to cast a single precision float value into a 64-bit long integer value. f2l removes a float from the stack, converts it to a long integer, and pushes the two-word long integer back onto the stack.

The value on the top of the operand stack must be of type float. It is popped from the operand stack and converted to a long. The result is pushed onto the operand stack:

Notes

The f2l instruction performs a narrowing primitive conversion. It may lose information about the overall magnitude of value, and may also lose precision.