Greater or equal
The ge
instructions, short for greater or equal, check if a number is greater than or equal to another number. If the first number is greater than or equal to the second number equal 1
will be pushed on to the stack, otherwise 0
will be pushed on to the stack.
The integer types have separate greater or equal instructions for signed (ge_s
) and unsigned (ge_u
) numbers.
Try it
Syntax
wasm
;; load 2 numbers on to the stack
local.get $num
i32.const 2
;; check if $num is greater than or equal to '2'
i32.ge_u
;; if $num is greater than or equal to the `2`, `1` will be pushed on to the stack,
;; otherwise `0` will be pushed on to the stack.
Instruction | Binary opcode |
---|---|
i32.ge_s |
0x4e |
i32.ge_u |
0x4f |
i64.ge_s |
0x59 |
i64.ge_u |
0x5a |
f32.ge |
0x60 |
f64.ge |
0x66 |