---
spec: JVMS
title: "The Java Virtual Machine Specification"
edition: "Java SE 21 Edition"
java_version: 21
chapter: "Chapter 6. The Java Virtual Machine Instruction Set"
section: "6.5.ineg"
heading: "ineg"
parent: "6.5. Instructions"
source: https://docs.oracle.com/javase/specs/jvms/se21/html/jvms-6.html#jvms-6.5.ineg
id: "6.5.ineg"
url: https://jvm.obfuscated.software/jvms/se21/6.5.ineg.html
raw: https://jvm.obfuscated.software/jvms/se21/6.5.ineg.md
---

# ineg

## Operation

Negate `int`

## Format

```
ineg
```

## Forms

*ineg* = 116 (0x74)

## Operand Stack

..., *value* →

..., *result*

## Description

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

For `int` 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 `int` results in that same maximum negative number. Despite the fact that overflow has occurred, no exception is thrown.

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