f32.ceil
Pops a f32 value off the stack, works out the ceiling value, and then pushes the result back on to the stack. This rounds up the value to the next whole number and removes any decimal parts. For example, 1.23 is rounded up to 2.0. For negative numbers it seems like it is rounded down, but it is just taking the negative value into account, so that -1.23 does not change to -2.00, but is changed to -1.0.

Syntax

f32.ceil

Stack In

f32 The value to get the ceiling value for.

Stack Out

f32 The ceiling value of the value given.

Examples

;; Push the f32 value 3.142 onto the stack
f32.const 3.142

;; Pop the f32 value off the stack, workout the ceiling value and
;; push the result back onto the stack
f32.ceil

;; The stack contains an f32 value of 4.0
;; Push the f32 value 4.95 onto the stack
f32.const 4.95

;; Pop the f32 value off the stack, workout the ceiling value and
;; push the result back onto the stack
f32.ceil

;; The stack contains an f32 value of 5.0
;; Push the f32 value -12.34 onto the stack
f32.const -12.34

;; Pop the f32 value off the stack, workout the ceiling value and
;; push the result back onto the stack
f32.ceil

;; The stack contains an f32 value of -12.00