Talk:Sieve of Eratosthenes: Difference between revisions

(→‎Trial division sieves should be moved from here: reply to old remark that I missed)
Line 1:
==Needs tidying up of examples that don't fit the task description==
 
I just looked at Racket and Python, but it seems that these languages have examples that ignore the task description in one or more of their optimisations. It could be present in other languages examples.
 
I would suggest the nonconforming examples be moved to this talk page or discarded as each language needs at least one clear implementation of the full task description. <br> Several non-conforming examples is excessive I think. --[[User:Paddy3118|Paddy3118]] ([[User talk:Paddy3118|talk]]) 05:30, 18 November 2014 (UTC)
 
==Optimizations==
My Forth is very rusty, but it looks like your Forth version of the [[Sieve_of_Eratosthenes]] lacks both important features of the sieve: The outer loop should stop at the sqrt of the total limit, and the inner loop should start with the square of the just detected prime (any other multiples must already have been crossed out). Without those, the sieve won't be faster than to trial division for each number. Some other implementations seem to have the same problem. (And some only sieve odd numbers, while others don't, making overall comparison between languages more difficult). Maybe all this should also be clarified in the task description? [[User:Dirkt|Dirkt]] 02:48, 2 December 2007 (MST)
Anonymous user