change(generatePrimes): Now skipping over even numbers
This commit is contained in:
parent
be0bbc896a
commit
8325cddef8
2
main.go
2
main.go
@ -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:
|
||||||
|
@ -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:
|
||||||
|
Loading…
Reference in New Issue
Block a user