Details
-
Improvement
-
Status: Open
-
Minor
-
Resolution: Unresolved
-
1.0
-
None
-
None
Description
The method Primes.nextPrime(int) can use the same algorithm to skip multiples of certain primes as SmallPrimes.boundedTrialDivision(int, int, List<Integer>) uses, instead of hard-coding the alternating increment of the trial candidate into a loop.
Also, if the argument of the method is smaller than or equal to the 512th prime number, the method can just infer the next higher prime number directly from the array SmallPrimes.PRIMES without performing any calculations.
Attachments
Issue Links
- links to