MCPcopy Create free account
hub / github.com/cortex-js/compute-engine / modPow

Function modPow

src/compute-engine/numerics/primes.ts:185–195  ·  view source on GitHub ↗
(base: bigint, exp: bigint, mod: bigint)

Source from the content-addressed store, hash-verified

183 5n,
184 7n,
185 11n,
186 13n,
187 17n,
188 19n,
189 23n,
190 29n,
191 31n,
192 37n,
193];
194
195export function isPrimeBigint(n: bigint): boolean {
196 if (n < 2n) return false;
197 if (n <= LARGEST_SMALL_PRIME) return SMALL_PRIMES.has(Number(n));
198 if (n < MILLER_RABIN_THRESHOLD) {

Callers 3

number-theory.tsFile · 0.90
sqrtModPrimeFunction · 0.90
millerRabinFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected