prev next contents
ineg

negate an integer

Jasmin Syntax


    ineg

Stack

Before

After
value
-value


Description

Pops an int off the stack, negates it, and pushes the negated integer value back onto the stack. This is the same as multiplying the integer by -1.

Bytecode

Type

Description
u1
ineg opcode = 0x74 (116)
See Also

lneg, fneg, dneg

Notes

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


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