16 releases
Uses old Rust 2015
0.3.4 | Jan 12, 2016 |
---|---|
0.3.3 | Jan 11, 2016 |
0.3.2 | Sep 6, 2015 |
0.3.1 | Aug 25, 2015 |
0.1.3 | Jun 27, 2015 |
#1801 in Math
17KB
393 lines
primapalooza
Name says it all. Handy prime number functions implemented in Rust.
Add primapalooza dependency to your project Cargo.toml file:
[dependencies]
primapalooza = "0.3.4"
Add primapalooza to your project's source code:
extern crate primapalooza;
use primapalooza::is_prime;
use primapalooza:generate_primes;
Methods signatures:
fn is_prime(usize) -> bool
fn is_prime_why_not(usize) -> bool
fn perfect_number(usize) -> bool
fn get_next_prime_number(usize) -> usize
fn get_twin_primes(usize) -> (usize, usize)
fn prime_factorization(usize) -> Vec<usize>
fn greatest_common_factor(usize, usize) -> usize
fn least_common_multiple(usize, usize) -> usize
fn number_of_primes(usize, usize) -> usize
fn number_of_factors(usize) -> usize
fn mersenne_prime(usize) -> usize
fn get_nth_prime(usize) -> usize
fn generate_primes(usize) -> Vec<usize>
fn is_lucky_number(usize) -> bool
fn is_triangular_number(usize) -> bool
License
Licensed under either of
- Apache License, Version 2.0, (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.
Dependencies
~240KB