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

# dsub

## Operation

Subtract `double`

## Format

```
dsub
```

## Forms

*dsub* = 103 (0x67)

## Operand Stack

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

..., *result*

## Description

Both *value1* and *value2* must be of type `double`. The values are popped from the operand stack. The `double` *result* is *value1* - *value2*. The *result* is pushed onto the operand stack.

For `double` subtraction, it is always the case that `a-b` produces the same result as `a+(-b)`. However, for the *dsub* instruction, subtraction from zero is not the same as negation, because if `x` is `+0.0`, then `0.0-x` equals `+0.0`, but `-x` equals `-0.0`.

The Java Virtual Machine requires support of gradual underflow. Despite the fact that overflow, underflow, or loss of precision may occur, execution of a *dsub* instruction never throws a run-time exception.
