User talk:IanOsgood: Difference between revisions

No edit summary
Line 13:
==Forth==
 
''A discussion was moved to [[Talk:Sieve of Eratosthenes]].''
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