change(generatePrimes): Now skipping over even numbers

This commit is contained in:
datalore 2024-10-03 00:51:21 +02:00
parent be0bbc896a
commit 8325cddef8
2 changed files with 2 additions and 2 deletions

View File

@ -89,7 +89,7 @@ func generatePrimesCPU(upperLimit int64, primes []int64, numRoutines int, progre
fmt.Printf("Calculating with %d routines\n\n", numRoutines) fmt.Printf("Calculating with %d routines\n\n", numRoutines)
for i := (primes[len(primes) - 1] + 1); i <= upperLimit; i++ { for i := (primes[len(primes) - 1] + 2); i <= upperLimit; i += 2 {
select { select {
case progress <- calculateProgress(6, upperLimit, 1, i): case progress <- calculateProgress(6, upperLimit, 1, i):
default: default:

View File

@ -26,7 +26,7 @@ func generatePrimesGPU(upperLimit int64, primes []int64, progress chan float32)
fmt.Printf("Calculating with tensorflow\n\n") fmt.Printf("Calculating with tensorflow\n\n")
for i := (primes[len(primes) - 1] + 1); i <= upperLimit; i++ { for i := (primes[len(primes) - 1] + 2); i <= upperLimit; i += 2 {
select { select {
case progress <- calculateProgress(6, upperLimit, 1, i): case progress <- calculateProgress(6, upperLimit, 1, i):
default: default: