From 8325cddef8e704104de20c6136dd409db78a4ca1 Mon Sep 17 00:00:00 2001 From: datalore Date: Thu, 3 Oct 2024 00:51:21 +0200 Subject: [PATCH] change(generatePrimes): Now skipping over even numbers --- main.go | 2 +- tensor.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/main.go b/main.go index b3f7828..58f4999 100644 --- a/main.go +++ b/main.go @@ -89,7 +89,7 @@ func generatePrimesCPU(upperLimit int64, primes []int64, numRoutines int, progre 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 { case progress <- calculateProgress(6, upperLimit, 1, i): default: diff --git a/tensor.go b/tensor.go index 4948101..d1a2671 100644 --- a/tensor.go +++ b/tensor.go @@ -26,7 +26,7 @@ func generatePrimesGPU(upperLimit int64, primes []int64, progress chan float32) 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 { case progress <- calculateProgress(6, upperLimit, 1, i): default: