Dieser Inhalt wurde automatisch aus dem Englischen übersetzt, und kann Fehler enthalten. Erfahre mehr über dieses Experiment.

View in English Always switch to English

min: Wasm-Textinstruktion

Die min-Instruktionen werden verwendet, um die kleinere von zwei Zahlen zu erhalten.

Probieren Sie es aus

(module (import "console" "log" (func $log (param f32))) (func $main ;; load `10` and `2` onto the stack f32.const 10 f32.const 2 f32.min ;; calculate the lower number call $log ;; log the result ) (start $main) ) 
const url = "{%wasm-url%}"; await WebAssembly.instantiateStreaming(fetch(url), { console }); 

Syntax

wat
;; load two numbers onto the stack f32.const 10 f32.const 3 ;; get lower number f32.min ;; the top item on the stack will now be 3 
Instruktion Binärer Opcode
f32.min 0x96
f64.min 0xa4