Skip to content

jacobcallear/primes

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Primes

Cargo tests and lints status

Find prime numbers in a given range.

Usage

Command line tool that prints prime numbers to standard output. Commands look like this:

./primes <start_of_range_to_search> <end_of_range>

Installation

  1. Install rust

  2. Clone or download this repository

  3. Compile with the following shell command:

    cargo build --release
  4. You now have the primes executable in ./target/release/

Examples

  • Find all prime numbers between 1 and 10:

    $ ./primes 1 10
    2
    3
    5
    7
  • Find all primes between 1,000,000,000,000,000 and 1,000,000,000,000,200

    $ ./primes 1000000000000000 1000000000000200
    1000000000000037
    1000000000000091
    1000000000000159
    1000000000000187

About

Find prime numbers fast

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages