MaxGraey / as-bignum

Fixed length big numbers for AssemblyScript 🚀

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Invalid result when using u128 mod operation

kolay-v opened this issue · comments

commented

My test case

as

export function test (a: u64, b: u64): u64 {
  return (u128Safe.from(a) % u128Safe.from(b)).toU64()
}

js

console.log(test(19n, 2n)) // outputs 0

Thanks!