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

# lcmp

## Operation

Compare `long`

## Format

```
lcmp
```

## Forms

*lcmp* = 148 (0x94)

## Operand Stack

..., *value1*, *value2* →

..., *result*

## Description

Both *value1* and *value2* must be of type `long`. They are both popped from the operand stack, and a signed integer comparison is performed. If *value1* is greater than *value2*, the `int` value 1 is pushed onto the operand stack. If *value1* is equal to *value2*, the `int` value 0 is pushed onto the operand stack. If *value1* is less than *value2*, the `int` value -1 is pushed onto the operand stack.
