A simple, efficient implementation of the Sieve of Eratosthenes in C.
C
Switch branches/tags
Nothing to show
Latest commit d79d95f Jun 18, 2012 @nathan-leclaire nathan-leclaire Modified readme
Permalink
Failed to load latest commit information.
README.md Modified readme Jun 18, 2012
primes Implemenation of the Sieve in C Jun 15, 2012
primes.c Implemenation of the Sieve in C Jun 15, 2012

README.md

Sieve of Eratosthenes

This is an implementation of the Sieve of Eratosthenes in C. I originally wrote something similar in PHP for an interview question and found it to be a fun little exercise. PHP was going painfully slow for values greater than 10000 or so, so I decided to get closer to the metal.

Usage

Usage is fairly straightforward. Invoke the executable from the command line with an argument indicating the number to calculate up to.

./primes 1000

will calculate all the primes up to 1000.