| Crates.io | primecount |
| lib.rs | primecount |
| version | 0.2.1 |
| created_at | 2020-06-21 06:58:45.08367+00 |
| updated_at | 2022-07-31 21:06:13.506222+00 |
| description | Rust wrapper for https://github.com/kimwalisch/primecount |
| homepage | https://github.com/maitbayev/primecount-rs |
| repository | https://github.com/maitbayev/primecount-rs |
| max_upload_size | |
| id | 256234 |
| size | 1,298,589 |
primecount-rs is a library that provides APIs for counting the primes below an integer x ≤ 10^31 using highly optimized implementations of the combinatorial prime counting algorithms.
It is a rust wrapper around an awesome kimwalisch/primecount library.
References:
Add to Cargo.toml of your project:
primecount = "0.2.0"
Examples:
use primecount;
fn main() {
println!("Primes below 1000 = {}", primecount::pi(1000));
println!(
"Numbers below 1000 that are not divisible by
any of the first 100 primes (a.k.a. Legendre-sum) = {}",
primecount::phi(1000, 100)
);
println!("10th prime = {}", primecount::nth_prime(10));
}
git submodule update --init --recursive
cargo build to build the librarycargo test to run the tests