f2l : convert float to long integer : index : visitInsn()

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.

Rounding is done using IEEE 754 round-to-nearest mode. The fractional part is lost by rounding towards zero, so (long)-3.14 becomes -3.

If the original value is NaN, the result is 0. If the value is too large to be represented as an integer, or if it is positive infinity, the result is the largest possible long integer Long.MAX_VALUE. If the value is too small (i.e. a negative value of large magnitude, or negative infinity) then the result is the most negative long integer Long.MIN_VALUE.
See also
f2i f2d
Stack
Before After
float long-word1
... long-word2
...
Bytecode
Type Description
u1 f2l opcode = 0x8C (140)