From 7384eaccf614143f14d2e139a18cc0b995521fb6 Mon Sep 17 00:00:00 2001 From: "Peter J. Holzer" Date: Mon, 12 Jul 2021 21:07:35 +0200 Subject: [PATCH] Don't print primes --- eratosthenes_parallel.go | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/eratosthenes_parallel.go b/eratosthenes_parallel.go index 6058388..c57c174 100644 --- a/eratosthenes_parallel.go +++ b/eratosthenes_parallel.go @@ -14,24 +14,13 @@ func main() { } t0 := time.Now() sieve := make([]bool, n) - col := 0 var found int64 var i int64 i = 2 found++ - s := fmt.Sprintf("%d, ", i) - fmt.Print(s) - col += len(s) for i = 3; i < n; i += 2 { if !sieve[i] { found++ - s := fmt.Sprintf("%d, ", i) - if col+len(s) > 80 { - fmt.Print("\n") - col = 0 - } - fmt.Print(s) - col += len(s) for j := i * i; j < n; j += 2 * i { sieve[j] = true }