---
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.f2d"
heading: "f2d"
parent: "6.5. Instructions"
source: https://docs.oracle.com/javase/specs/jvms/se16/html/jvms-6.html#jvms-6.5.f2d
id: "6.5.f2d"
url: https://jvm.obfuscated.software/jvms/se16/6.5.f2d.html
raw: https://jvm.obfuscated.software/jvms/se16/6.5.f2d.md
---

# f2d

## Operation

Convert `float` to `double`

## Format

```
f2d
```

## Forms

*f2d* = 141 (0x8d)

## Operand Stack

..., *value* →

..., *result*

## Description

The *value* on the top of the operand stack must be of type `float`. It is popped from the operand stack and undergoes value set conversion ([§2.8.3](2.8.3.md)), resulting in *value*'. Then *value*' is converted to a `double` *result*. This *result* is pushed onto the operand stack.

## Notes

Where an *f2d* instruction is FP-strict ([§2.8.2](2.8.2.md)) it performs a widening primitive conversion (JLS §5.1.2). Because all values of the float value set ([§2.3.2](2.3.2.md)) are exactly representable by values of the double value set ([§2.3.2](2.3.2.md)), such a conversion is exact.

Where an *f2d* instruction is not FP-strict, the result of the conversion may be taken from the double-extended-exponent value set; it is not necessarily rounded to the nearest representable value in the double value set. However, if the operand *value* is taken from the float-extended-exponent value set and the target result is constrained to the double value set, rounding of *value* may be required.
