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

# dadd

## Operation

Add `double`

## Format

```
dadd
```

## Forms

*dadd* = 99 (0x63)

## Operand Stack

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

..., *result*

## Description

Both *value1* and *value2* must be of type `double`. The values are popped from the operand stack and undergo value set conversion ([§2.8.3](2.8.3.md)), resulting in *value1*' and *value2*'. The `double` *result* is *value1*' + *value2*'. The *result* is pushed onto the operand stack.

The result of a *dadd* instruction is governed by the rules of IEEE 754 arithmetic:

- If either *value1*' or *value2*' is NaN, the result is NaN.
- The sum of two infinities of opposite sign is NaN.
- The sum of two infinities of the same sign is the infinity of that sign.
- The sum of an infinity and any finite value is equal to the infinity.
- The sum of two zeroes of opposite sign is positive zero.
- The sum of two zeroes of the same sign is the zero of that sign.
- The sum of a zero and a nonzero finite value is equal to the nonzero value.
- The sum of two nonzero finite values of the same magnitude and opposite sign is positive zero.
- In the remaining cases, where neither operand is an infinity, a zero, or NaN and the values have the same sign or have different magnitudes, the sum is computed and rounded to the nearest representable value using the round to nearest rounding policy ([§2.8](2.8.md)). If the magnitude is too large to represent as a`double`, we say the operation overflows; the result is then an infinity of appropriate sign. If the magnitude is too small to represent as a `double`, we say the operation underflows; the result is then a zero of appropriate sign.

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