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

# l2f

## Operation

Convert `long` to `float`

## Format

```
l2f
```

## Forms

*l2f* = 137 (0x89)

## Operand Stack

..., *value* →

..., *result*

## Description

The *value* on the top of the operand stack must be of type `long`. It is popped from the operand stack and converted to a `float` *result* using the round to nearest rounding policy ([§2.8](2.8.md)). The *result* is pushed onto the operand stack.

## Notes

The *l2f* instruction performs a widening primitive conversion (JLS §5.1.2) that may lose precision because values of type `float` have only 24 significand bits.
