mod result
This commit is contained in:
parent
0455d91928
commit
11f91330df
2
main.js
2
main.js
|
|
@ -112,7 +112,7 @@ function compute(queue, modulus) {
|
||||||
throw new Error("error evaluating expression");
|
throw new Error("error evaluating expression");
|
||||||
}
|
}
|
||||||
|
|
||||||
let result = stack[0];
|
let result = stack[0] % modulus;
|
||||||
if (result < 0n) {
|
if (result < 0n) {
|
||||||
result += modulus;
|
result += modulus;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue