Click here to Skip to main content
11,642,855 members (72,642 online)
Click here to Skip to main content
Add your own
alternative version

Tagged as

Find Prime Numbers in C# Using the Sieve of Eratosthenes

, 12 Sep 2011 CPOL 5.3K
Here's an alternative. This one uses the BitArray class in C# and does not use the % operator.static List SeiveWithoutMod(int candidate){ BitArray sieveContainer = new BitArray(candidate + 1, true); int marker = 2; //start int factor = 2; //start. sieveContainer[0]...




This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Bill Anderson
Web Developer
United States United States

You may also be interested in...

| Advertise | Privacy | Terms of Use | Mobile
Web01 | 2.8.150731.1 | Last Updated 12 Sep 2011
Article Copyright 2011 by Bill Anderson
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid