this is zig function
export fn twoed(n: i32) i32 {
return n * 2;
}
export fn rando(seed: u128, min: u128, max: u128) u128 {
return (((seed * 1103515245) + 12345) & 0x7FFFFFFF) % (max - min) + min;
}
I built with this command
zig build-lib -dynamic -rdynamic -target wasm32-freestanding bum.zig
And called it from JavaScript
"use strict";
const wasmModule = await WebAssembly.instantiateStreaming(fetch('bum.wasm'));
const { twoed, rando } = wasmModule.instance.exports;
console.log(twoed(10));
console.log(rando(Math.floor(Date.now() / 1000), 200, 5302));
and I got this error for the rando function
Uncaught TypeError: can't convert 200 to BigInt
help