|
opcode: 140 (0x8c) |
|
usage: f2l |
|
stack before: ..., value
stack after: ..., result.word1, result.word2 |
|
description: |
The top word of the operand stack, value, must be a float. To execute the f2l instruction, the Java Virtual Machine pops the float value from the operand stack, converts the float to a long, and pushes the long result.
To convert the float value to long, the Java Virtual Machine first checks to see if the value equals NaN (Not a Number). If so, the long result is zero. Else, if the float value is not a positive or negative infinity, the virtual machine rounds the value towards zero using IEEE 754 round-towards-zero mode. If the resulting integral value can be exactly represented by a long, the long result is that integral value. Otherwise, the magnitude of the float value is too great be represented in a long. If value is positive, the long result is the largest positive integer representable in a long. If value is negative, the int result is the smallest negative integer representable in a long.
Note that this instruction performs a narrowing primitive conversion. Because not all float values are representable by a long, the conversion may result in a loss of magnitude and precision.
|
|
|