Convert float
to long
Bytecode
Type | Description |
u1 | f2l opcode = 0x8C (140) |
Stack ..., value => ..., result.word1, result.word2
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:
long
0. long
, then the result is the long
value V. long
, or the value must be too large (a positive value of
large magnitude or positive infinity), and the result is the largest representable
value of type long
. The f2l instruction performs a narrowing primitive conversion. It may lose information about the overall magnitude of value, and may also lose precision.