Path: blob/main/files/en-us/webassembly/reference/numeric/convert/index.md
6510 views
------{{WebAssemblySidebar}}
The convert instructions, are used for converting integer numbers to floating point numbers. There are signed and unsigned versions of this instruction.
{{EmbedInteractiveExample("pages/wat/convert.html", "tabbed-taller")}}
Syntax
| Instruction | Binary opcode |
|---|---|
f32.convert_i32_s | 0xb2 |
f32.convert_i32_u | 0xb3 |
f32.convert_i64_s | 0xb4 |
f32.convert_i64_u | 0xb5 |
f64.convert_i32_s | 0xb7 |
f64.convert_i32_u | 0xb8 |
f64.convert_i64_s | 0xb9 |
f64.convert_i64_u | 0xba |