prev next contents
lneg

negate a long

Jasmin Syntax


    lneg

Stack

Before

After
value-word1
result-word1
value-word2
result-word2
...
...
Description

Removes the top long integer from the operand stack, negates it, and pushes the negated result back onto the stack. This is the same as multiplying the long integer by -1, which is the same as (~value) + 1.

Bytecode

Type

Description
u1
lneg opcode = 0x75 (117)
See Also

ineg, fneg, dneg

Notes

Because of the two's-complement representation used for negative numbers, negating Long.MIN_VALUE actually produces Long.MIN_VALUE, not Long.MAX_VALUE as you might expect.


prev next contents
Java Virtual Machine, by Jon Meyer and Troy Downing, O'Reilly Associates