3 ms·
> numberBigInt = numberBigInt.minus(1) https://github.com/geonnave/primg/blob/master/index.html#L82 https://github.com/geonnave/primg/blob/master/index.html#L8
by ot 9y ago
> numberBigInt = numberBigInt.minus(1)
https://github.com/geonnave/primg/blob/master/index.html#L82 https://github.com/geonnave/primg/blob/master/index.html#L82
Could go double as fast subtracting 2 instead of 1 (why try the even numbers).
- geonnave 9y agoI assume the BigInteger library, which offers isPrime() and isProbablyPrime() functions, already does that kind of optimization.