f64.trunc
Pops a f64
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 f64.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
f64 |
The value to get truncated. |
Stack Out
f64 |
The truncated value of the value given. |
Examples
f64.const 3.142
f64.trunc
f64.const -12.34
f64.trunc