i32.reinterpret_f32
Pops a f32 value off the stack, keeping its binary form, pushes it onto the stack as an i32 value. The binary structure of a f32 value is copied as it is, not its value, into an i32 value. This is like copying the floating point value into memory and then reading it with an integer. The binary bits are the same, however the numeric value is totally different.

Syntax

i32.reinterpret_f32

Stack In

f32 The value to be transferred.

Stack Out

i32 The i32 binary copy of the f32 value.

Example

;; Translate f32 1234.567 into an i32 value
f32.const 1234.567
i32.reinterpret_f32

;; The stack contains an i32 value of the binary f32 value for 1234.567

;; Translate it back from the i32 binary into a f32 value
f32.reinterpret_i32

;; The stack contains a f32 value of 1234.567