Nearest
Die nearest
Anweisungen werden verwendet, um den Wert einer Zahl auf die nächste ganze Zahl gerundet zu erhalten.
Probieren Sie es aus
Syntax
wasm
;; load a number onto the stack
f32.const -2.7
;; round to the nearest integer
f32.nearest
;; the top item on the stack will now be -3
Anweisung | Binärer Opcode |
---|---|
f32.nearest |
0x90 |
f64.nearest |
0x9e |