GO-Ve01
ServicesDevelopersBooksDictionaryPapersWikidataEncyclopediaSearchBabelCareersDeck

promote_32: Wasm numeric instruction

The promote32 numeric instruction is used to convert (promote) numbers of type f32 to type f64.

The **`promote_32`** [numeric instruction](/docs/WebAssembly/Reference/Numeric) is used to convert (promote) numbers of type `f32` to type `f64`.

tabbed-taller

```wat interactive-example
(module
(import "console" "log" (func $log (param f64)))
(func $main

f32.const 10.5 ;; push an f32 onto the stack

f64.promote_f32 ;; promote from f32 to f64

call $log ;; log the result

)
(start $main)
)
```

```js interactive-example
const url = "{%wasm-url%}";
await WebAssembly.instantiateStreaming(fetch(url), { console });
```

## Syntax

```wat
;; push an f32 onto the stack
f32.const 10.5

;; promote from f32 to f64
f64.promote_f32

;; the top item on the stack will now be the value 10.5 of type f64
```

| Instruction | Binary opcode |
| ----------------- | ------------- |
| `f64.promote_f32` | `0xbb` |

## Specifications

## Browser compatibility

source: MDN Web Docs mirror · page

Cite this

"promote_32: Wasm numeric instruction". MDN Web Docs. CC BY-SA 2.5 (MDN). https://developer.mozilla.org/en-US/docs/WebAssembly/Reference/Numeric/promote_32

JSON record · API collection · BibTeX · RIS · CSL-JSON · citation policy

Save to pass ·