Click here to Skip to main content
15,793,402 members
Home / Discussions / C#
   

C#

 
GeneralRe: Sieve of Eratosthenes Pin
WebMaster12-Sep-12 6:48
WebMaster12-Sep-12 6:48 
GeneralRe: Sieve of Eratosthenes Pin
J4amieC12-Sep-12 6:59
J4amieC12-Sep-12 6:59 
GeneralRe: Sieve of Eratosthenes Pin
WebMaster12-Sep-12 7:11
WebMaster12-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
subeditorPete O'Hanlon12-Sep-12 7:25 
AnswerProper implementation of Sieve of Eratosthenes Pin
Clifford Nelson12-Sep-12 11:45
Clifford Nelson12-Sep-12 11:45 
GeneralRe: Proper implementation of Sieve of Eratosthenes Pin
WebMaster12-Sep-12 12:00
WebMaster12-Sep-12 12:00 
AnswerRe: Proper implementation of Sieve of Eratosthenes Pin
Clifford Nelson12-Sep-12 12:20
Clifford Nelson12-Sep-12 12:20 
If you want the sum or primes then:

static void Main(string[] args)
    {
        var sw = new Stopwatch();
        sw.Start();
        Run();
        sw.Stop();
        Console.WriteLine("Milliseconds run: " + sw.ElapsedMilliseconds);
        Console.WriteLine("Primes: " + _numbers.Count(i => i));
        var sum = 0;
        for (int i = 2; i < _numbers.Count(); i++)
            if (_numbers[i]) sum += i;
        Console.WriteLine("Sum of Primes: " + sum.ToString("n0"));

        Console.ReadLine();
    }

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
Clifford 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
mentorThomas 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 
QuestionSubstitution of Paths in HyperLinkField with File Names Pin
ASPnoob12-Sep-12 5:23
ASPnoob12-Sep-12 5:23 
AnswerRe: Substitution of Paths in HyperLinkField with File Names Pin
Pete O'Hanlon12-Sep-12 5:55
subeditorPete O'Hanlon12-Sep-12 5:55 
GeneralRe: Substitution of Paths in HyperLinkField with File Names Pin
ASPnoob12-Sep-12 10:59
ASPnoob12-Sep-12 10:59 
QuestionRetrieve name of Printer using SendMessage Pin
toBeH_S11-Sep-12 23:10
toBeH_S11-Sep-12 23:10 
AnswerRe: Retrieve name of Printer using SendMessage Pin
Rage12-Sep-12 7:40
professionalRage12-Sep-12 7:40 
GeneralRe: Retrieve name of Printer using SendMessage Pin
toBeH_S12-Sep-12 9:33
toBeH_S12-Sep-12 9:33 
GeneralRe: Retrieve name of Printer using SendMessage Pin
Rage12-Sep-12 22:25
professionalRage12-Sep-12 22:25 
GeneralRe: Retrieve name of Printer using SendMessage Pin
toBeH_S16-Sep-12 16:18
toBeH_S16-Sep-12 16:18 
QuestionRandom Permutation Interface Pin
Skippums11-Sep-12 16:58
Skippums11-Sep-12 16:58 
AnswerRe: Random Permutation Interface Pin
Dave Kreskowiak11-Sep-12 18:44
mveDave Kreskowiak11-Sep-12 18:44 
AnswerRe: Random Permutation Interface Pin
BillWoodruff12-Sep-12 1:05
professionalBillWoodruff12-Sep-12 1:05 

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.