f32.trunc
Pops a f32
value off the stack, truncates the value, and then
pushes the result back on to the stack. This removes any decimal parts to leave only the
whole number remaining. It is similar to the f32.floor
instruction except it
operates differently will negative numbers. For example, 1.23 becomes 1.0, and -1.23 becomes -1.0,
unlike the floor instruction which would result in -2.0.
Stack In
f32 |
The value to get truncated. |
Stack Out
f32 |
The truncated value of the value given. |
Examples
f32.const 3.142
f32.trunc
f32.const -12.34
f32.trunc