Click here to Skip to main content
15,112,354 members
Home / Discussions / C#
   

C#

 
GeneralRe: Sieve of Eratosthenes Pin
Richard MacCutchan12-Sep-12 6:40
mveRichard MacCutchan12-Sep-12 6:40 
AnswerRe: Sieve of Eratosthenes Pin
J4amieC12-Sep-12 5:53
MemberJ4amieC12-Sep-12 5:53 
AnswerRe: Sieve of Eratosthenes Pin
Pete O'Hanlon12-Sep-12 5:54
mvePete O'Hanlon12-Sep-12 5:54 
GeneralRe: Sieve of Eratosthenes Pin
WebMaster12-Sep-12 5:59
MemberWebMaster12-Sep-12 5:59 
GeneralRe: Sieve of Eratosthenes Pin
J4amieC12-Sep-12 6:02
MemberJ4amieC12-Sep-12 6:02 
GeneralRe: Sieve of Eratosthenes Pin
Manfred Rudolf Bihy12-Sep-12 6:06
professionalManfred Rudolf Bihy12-Sep-12 6:06 
GeneralRe: Sieve of Eratosthenes Pin
J4amieC12-Sep-12 6:07
MemberJ4amieC12-Sep-12 6:07 
GeneralRe: Sieve of Eratosthenes Pin
Pete O'Hanlon12-Sep-12 6:04
mvePete O'Hanlon12-Sep-12 6:04 
I hate to break it to you bubba, but your algorithm isn't that algorithm. You are brute forcing to test against the result of the division to see if the remainder is zero. That's not what this algorithm does; it's a simpler, more elegant implementation. Look at the pseudo code of the wiki page I linked to - that's what your code should look like.

*pre-emptive celebratory nipple tassle jiggle* - Sean Ewington

"Mind bleach! Send me mind bleach!" - Nagy Vilmos


CodeStash - Online Snippet Management | My blog | MoXAML PowerToys | Mole 2010 - debugging made easier

GeneralRe: Sieve of Eratosthenes Pin
WebMaster12-Sep-12 6:16
MemberWebMaster12-Sep-12 6:16 
GeneralRe: Sieve of Eratosthenes Pin
Pete O'Hanlon12-Sep-12 6:22
mvePete O'Hanlon12-Sep-12 6:22 
GeneralRe: Sieve of Eratosthenes Pin
J4amieC12-Sep-12 6:23
MemberJ4amieC12-Sep-12 6:23 
GeneralRe: Sieve of Eratosthenes Pin
WebMaster12-Sep-12 6:48
MemberWebMaster12-Sep-12 6:48 
GeneralRe: Sieve of Eratosthenes Pin
J4amieC12-Sep-12 6:59
MemberJ4amieC12-Sep-12 6:59 
GeneralRe: Sieve of Eratosthenes Pin
WebMaster12-Sep-12 7:11
MemberWebMaster12-Sep-12 7:11 
GeneralRe: Sieve of Eratosthenes Pin
Rage12-Sep-12 7:23
professionalRage12-Sep-12 7:23 
GeneralRe: Sieve of Eratosthenes Pin
Pete O'Hanlon12-Sep-12 7:25
mvePete O'Hanlon12-Sep-12 7:25 
AnswerProper implementation of Sieve of Eratosthenes Pin
Clifford Nelson12-Sep-12 11:45
MemberClifford Nelson12-Sep-12 11:45 
GeneralRe: Proper implementation of Sieve of Eratosthenes Pin
WebMaster12-Sep-12 12:00
MemberWebMaster12-Sep-12 12:00 
AnswerRe: Proper implementation of Sieve of Eratosthenes Pin
Clifford Nelson12-Sep-12 12:20
MemberClifford Nelson12-Sep-12 12:20 
GeneralRe: Proper implementation of Sieve of Eratosthenes Pin
Dave Kreskowiak12-Sep-12 13:44
mveDave Kreskowiak12-Sep-12 13:44 
GeneralRe: Proper implementation of Sieve of Eratosthenes Pin
Clifford Nelson12-Sep-12 14:07
MemberClifford Nelson12-Sep-12 14:07 
GeneralRe: Proper implementation of Sieve of Eratosthenes Pin
Dave Kreskowiak12-Sep-12 19:25
mveDave Kreskowiak12-Sep-12 19:25 
AnswerRe: Sieve of Eratosthenes Pin
Thomas Daniels12-Sep-12 6:29
mvaThomas Daniels12-Sep-12 6:29 
AnswerRe: Sieve of Eratosthenes Pin
Kenneth Haugland13-Sep-12 4:33
professionalKenneth Haugland13-Sep-12 4:33 
AnswerRe: Sieve of Eratosthenes Pin
PIEBALDconsult12-Sep-12 15:23
professionalPIEBALDconsult12-Sep-12 15:23 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.