Returns a generator with a number's factors. Uses a pre-computed sieve up to 16K, then Brent's algorithm, which has a small chance of failing
The number to be factored.
GCD, for either two numbers or two BigInts.
The Miller Rabin algorithm. The opposite of [isPrime].
For the moment, due to lack of universal BigInt support and unlikeliness of need, we accept that it will be inaccurate on platforms w/o BigInt (e.g. Safari) above 94906265 (Math.floor(Math.sqrt(Number.MAX_SAFE_INTEGER)).
true if n is prime, else returns false
The Miller Rabin algorithm.
For the moment, due to lack of universal BigInt support and unlikeliness of need, we accept that it will be inaccurate on platforms w/o BigInt (e.g. Safari) above 94906265 (Math.floor(Math.sqrt(Number.MAX_SAFE_INTEGER)).
true if n is prime, else returns false
Extended GCD
such that gcdfactor_a = a, gcdfactor_b = b.
Generated using TypeDoc
Algebraic manipulations.