Zähle nachfolgende Nullen
Die ctz
Anweisungen, kurz für count trailing zeros, werden verwendet, um die Anzahl der Nullen am Ende der binären Darstellung einer Zahl zu zählen.
Probieren Sie es aus
Syntax
wasm
;; load a number onto the stack
i32.const 8388608 ;; 00000000_10000000_00000000_00000000
;; count trailing zeros
i32.ctz
;; the top item on the stack will now be 23
Anweisung | Binärer Opcode |
---|---|
i32.ctz |
0x68 |
i64.ctz |
0x7a |