From 71e2303ecc6d09857768cd7a91456ffb4254bd0e Mon Sep 17 00:00:00 2001 From: Kim Walisch Date: Sun, 7 Jan 2024 20:26:05 +0100 Subject: [PATCH] Fix threshold --- src/nthPrime.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nthPrime.cpp b/src/nthPrime.cpp index d4af64744..f6185ba42 100644 --- a/src/nthPrime.cpp +++ b/src/nthPrime.cpp @@ -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);