change to bigint
This commit is contained in:
@@ -39,7 +39,7 @@ function modpow(base, exponent, modulus) {
|
||||
let result = 1n;
|
||||
base %= modulus;
|
||||
|
||||
while (exponent > 0) {
|
||||
while (exponent > 0n) {
|
||||
if (exponent % 2n === 1n) {
|
||||
result *= base;
|
||||
result %= modulus;
|
||||
|
||||
Reference in New Issue
Block a user