comp.lang.ada
 help / color / mirror / Atom feed
From: "Jeffrey R. Carter" <spam.not.jrcarter@acm.not.spam.org>
Subject: Re: ada is getting spanked :(
Date: Sun, 29 Oct 2006 17:25:18 GMT
Date: 2006-10-29T17:25:18+00:00	[thread overview]
Message-ID: <2u51h.122195$aJ.118934@attbi_s21> (raw)
In-Reply-To: <SpU0h.121318$aJ.65682@attbi_s21>

Also for nsieve, M is defined to be a multiple of 2, and so we know it 
is not prime. We can omit it from consideration by changing the loop 
condition to

while I < M loop

This is done by the C++ program in 2nd place, for example:

for (size_t i=2; i<m; ++i)
   if (isPrime[i])
     {
       for(size_t k=i*2; k<m; k+=i)
         isPrime[k] = false;
       ++count;
     }

which only looks at 2 .. M - 1.

I don't expect much of an improvement from this, though.

-- 
Jeff Carter
"I'm a kike, a yid, a heebie, a hook nose! I'm Kosher,
Mum! I'm a Red Sea pedestrian, and proud of it!"
Monty Python's Life of Brian
77



  parent reply	other threads:[~2006-10-29 17:25 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-10-28 16:29 ada is getting spanked :( cl1
2006-10-28 17:45 ` Martin Krischik
2006-10-28 20:02   ` Georg Bauhaus
2006-10-29  1:34   ` Georg Bauhaus
2006-10-29  2:13     ` Jeffrey R. Carter
2006-10-29  4:48       ` Isaac Gouy
2006-10-30  1:01         ` Isaac Gouy
2006-10-29  2:26     ` Jeffrey R. Carter
2006-10-29  2:30       ` Jeffrey R. Carter
2006-10-29  2:33         ` Jeffrey R. Carter
2006-10-29 17:19           ` Jeffrey R. Carter
2006-10-29 17:25           ` Jeffrey R. Carter [this message]
2006-10-29  8:54     ` Martin Krischik
2006-10-29 13:01       ` Georg Bauhaus
2006-10-30  0:46         ` Isaac Gouy
2006-10-29 16:27     ` Björn Persson
2006-10-29 20:23       ` Georg Bauhaus
2006-10-29 23:50         ` Björn Persson
2006-10-31 11:32           ` Dmitry A. Kazakov
2006-10-31 13:12             ` Georg Bauhaus
2006-10-31 14:14               ` Dmitry A. Kazakov
2006-10-31 18:01       ` Martin Krischik
2006-10-29  4:58   ` Isaac Gouy
2006-10-29  8:46     ` Martin Krischik
2006-10-30  0:17       ` Isaac Gouy
2006-10-30 18:26   ` jtg
2006-10-30 21:50     ` george
2006-10-31  4:57     ` Jeffrey R. Carter
2006-10-31  6:28     ` Gautier
2006-10-31  6:47     ` Martin Krischik
2006-11-02 18:21       ` Jeffrey R. Carter
2006-11-02 19:37         ` Gautier
2006-11-03  5:11           ` Jeffrey R. Carter
2006-11-03 12:06         ` Martin Krischik
2006-11-03 19:59           ` Jeffrey R. Carter
2006-11-12 22:26   ` Shootout / pidigits [Re: ada is getting spanked :(] Gautier
2006-10-28 22:45 ` ada is getting spanked :( Larry Kilgallen
2006-10-29 16:22 ` Leif Holmgren
2006-10-29 17:28   ` Simon Wright
2006-10-29 19:21   ` jtg
2006-10-29 21:33     ` Leif Holmgren
2006-10-31 11:04       ` Harald Korneliussen
2006-11-01 11:28         ` jtg
2006-11-01 14:31           ` Harald Korneliussen
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox