diff options
author | Aymen Dirar | 2022-10-24 06:29:34 +0000 |
---|---|---|
committer | Aymen Dirar | 2022-10-24 06:29:34 +0000 |
commit | 5e2b3d53917bb6a39dbffd0db6888bacaa283536 (patch) | |
tree | 267674dd842fc69fd8a0481ef780693719237dbc /entries | |
parent | 51ebb554063aa504668e939c766236967829b94b (diff) |
handle negative
Diffstat (limited to 'entries')
-rw-r--r-- | entries/adirar111/wasm/index.js | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/entries/adirar111/wasm/index.js b/entries/adirar111/wasm/index.js index 43ee9a6..667ff82 100644 --- a/entries/adirar111/wasm/index.js +++ b/entries/adirar111/wasm/index.js @@ -10,8 +10,10 @@ WebAssembly.instantiateStreaming(fetch(wasmBinaryDataURL)).then( const result = document.getElementById("result") const n = parseInt(input.value) if (isNaN(n)) { - result.textContent = "that's not a number..." - return + return result.textContent = "that wasn't very wasm of you" + } + if (n < 0) { + return result.textContent = "why are you being so negative" } result.textContent = fibWasm(n) } |