dconst_0
or
dconst_1
Stack
Before
Description
After
...
<d>-word1
<d>-word2
...
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 stackBytecode
Type
|
Description
|
|
u1
|
dconst_0
opcode = 0x0E (14)
|
|
u1
|
dconst_1
opcode = 0x0F (15)
|
bipush, sipush, ldc, ldc_w, ldc2_w, aconst_null, iconst_m1, iconst_<n>, lconst_<l>, fconst_<f>,