Skip to content

Commit

Permalink
Fix threshold
Browse files Browse the repository at this point in the history
  • Loading branch information
kimwalisch committed Jan 7, 2024
1 parent e4600af commit 71e2303
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/nthPrime.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ uint64_t PrimeSieve::nthPrime(int64_t n, uint64_t start)
// O(x^0.5 log log x^0.5) occurs only once (instead of twice) when
// using primesieve::iterator further down.
if (start < primeApprox &&
primeApprox - start > isqrt(primeApprox - start) / 10)
primeApprox - start > isqrt(primeApprox) / 10)
{
// Count primes > start
start = checkedAdd(start, 1);
Expand Down

0 comments on commit 71e2303

Please sign in to comment.