Contents | Prev | Next | Index

lneg

Operation
Negate long

lneg

Forms
lneg = 117 (0x75)

Stack
..., value.word1, value.word2 ..., result.word1, result.word2

Description
The value must be of type long. It is popped from the operand stack. The long result is the arithmetic negation of value, -value. The result is pushed onto the operand stack.

For long values, negation is the same as subtraction from zero. Because the Java Virtual Machine uses two's-complement representation for integers and the range of two's-complement values is not symmetric, the negation of the maximum negative long results in that same maximum negative number. Despite the fact that overflow has occurred, no exception is thrown.

For all long values x, -x equals (~x) + 1.


Contents | Prev | Next | Index

Java Virtual Machine Specification (HTML generated by dkramer on February 25, 1997)
Copyright © 1996 Sun Microsystems, Inc. All rights reserved
Please send any comments or corrections to doug.kramer@sun.com