Skip to content

illegitimate-egg/sieve-of-eratosthenes

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sieve Of Eratosthenes

A simple C++ implementation of the sieve of eratosthenes.

Argument usage

If you would like to run with arguments the option is available, just follow this convention:
./main [limit] [mode (0/1/2)]
Available modes are:

  1. No output
  2. Printed output
  3. File output (primes.txt)

WARNING: Outputting large numbers of primes to a file make have catastrophic consequences, during development I outputted primes under 1 trillion to a file and ended up with an 8GB file and a locked file system before I could stop the program. NOTE: The program gives wrong results with numbers higher than about 4 billion. This is a bug and needs to be fixed.