primal 0.3.3

`primal` puts raw power into prime numbers. This crates includes: optimised prime sieves, checking for primality, enumerating primes, factorising numbers, and state-of-the-art estimation of upper and lower bounds for π(n) (the number of primes below n) and p_k (the k-th prime).
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use std::env;
use std::time::Instant;

fn main() {
    let mut args = env::args();
    let max = args
        .nth(1).and_then(|s| s.parse::<f64>().ok().map(|x| x as usize))
        .unwrap_or(1_000_000);

    let start = Instant::now();
    let count = primal::StreamingSieve::prime_pi(max);
    let time = start.elapsed();

    println!("{} primes below {} in {:?} (est: {:?})",
             count, max, time, primal::estimate_prime_pi(max as u64));
}