JVM Knowledge

l2d

Raw .md Oracle

Operation

Convert long to double

Format

l2d

Forms

l2d = 138 (0x8a)

Operand Stack

..., value →

..., result

Description

The value on the top of the operand stack must be of type long. It is popped from the operand stack and converted to a double result using the round to nearest rounding policy (§2.8). The result is pushed onto the operand stack.

Notes

The l2d instruction performs a widening primitive conversion (JLS §5.1.2) that may lose precision because values of type double have only 53 significand bits.