Push double 0.0 or 1.0
Bytecode
Type | Description |
u1 | dconst_0 opcode = 0x0E (14) |
u1 | dconst_1 opcode = 0x0F (15) |
Stack ... => ..., <d>.word1, <d>.word2
Description
dconst_<d> pushes the constant double precision floating point number <d> onto the stack, where <d> is either 0 or 1. For example, to push the double precision float 0.0 onto the stack, use:
dconst_0 ; push the double 0.0 onto the stack
Note that you could also use:
ldc2_w 0.0 ; push the double
0.0 onto the stack
although this instruction takes more space in the class file and is typically less efficient.
Example
dconst_0 ; push the double 0.0 onto the stack dconst_1 ; push the double 1.0 onto the stack