Crates.io | primeval |
lib.rs | primeval |
version | 1.0.0 |
source | src |
created_at | 2018-12-19 04:18:44.146009 |
updated_at | 2019-08-15 23:07:57.942746 |
description | A monstrosity of a prime number generator |
homepage | |
repository | https://github.com/ajmwagar/primeval-rs |
max_upload_size | |
id | 102647 |
size | 11,695 |
A monstrosity of a prime number generator. (It's dead simple)
primeval help
: displays a help menu.primeval gen <limit>
: generates all the prime numbers up to a limitprimeval prime <number>
: determines whether a number is prime or notprimeval version
: shows version infomain.rs
extern crate primeval;
fn main(){
// Primality?
let result = primeval::is_prime(2);
// Generation, in this case all the primes from 0 - 1000
let result: Vec<usize> = primeval::primes_gen(1000).collect::<Vec<_>>();
}
git clone https://github.com/ajmwagar/primeval-rs
cd primeval-rs
cargo build --release
cd target/release
./primeval help
You can also move the binary into /usr/bin
or somewhere else in your PATH
to use from anywhere.
cargo test
cargo bench