i2fStack
Before | After |
int | float |
... | ... |
Pops an int off the operand stack, casts it into a single-precision float, and pushes the float back onto the stack. Notice that there is may be a loss of precision (floats have 24 bits of significand, as compared to 32 bits for an int, so the least significant bits of int are lost). However, the magnitude of the result will be preserved (the range of a float is greater than the range of an int). Rounding is done using the IEEE 754 round-to-nearest mode.
Bytecode Type
See Also Description u1 i2f opcode = 0x86 (134)
i2l, i2d