You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This repo contains implementations of a Sieve of Eratosthenes, an algorithm to find prime numbers up to N. It does this by creating a list, starting at 2, and runs through each integer and removes all composite digits. There is one implementation in C, one in ML, and one in Elixir.
To run:
Clone repo
C:
cd to/C/directory
run make
run ./primesMT + -t num_threads -u upper_bound where num_threads is the number of threads you want to dedicate and upper_bound is the highest possible prime to find
Or to run automated tests this will execute and time for various upper bounds and threads. Use ./testPrimesC
Elixir
cd to/Elixir/directory
run elixir primesMT.ex and follow prompt
ML
Enter ML directory
run the bash script./testSML to run the automated tests.
or ./ any of the programs to test individually ex ./500KPrimes
Otherwise edit line number 46 val myPrimes = primes( "Place Upper Bound Here" );
After changing primesMT.sml can be compiled with mlton using mlton primesMT.sml
Then execute.
Created by Taylor Mallory and Mike Winberry
About
This repo contains implementations of a Sieve of Eratosthenes. One in C, one in ML, and one in Elixir.