Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/uccidibuti/divisors
A blazing fast Rust library to find all divisors of a natural number. This library works with u8, u16, u32, u64, u128 and usize types.
https://github.com/uccidibuti/divisors
algorithms divisors
Last synced: about 1 month ago
JSON representation
A blazing fast Rust library to find all divisors of a natural number. This library works with u8, u16, u32, u64, u128 and usize types.
- Host: GitHub
- URL: https://github.com/uccidibuti/divisors
- Owner: uccidibuti
- Created: 2019-06-25T00:38:36.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2022-11-25T18:34:38.000Z (about 2 years ago)
- Last Synced: 2024-09-16T23:30:22.602Z (3 months ago)
- Topics: algorithms, divisors
- Language: Rust
- Size: 9.77 KB
- Stars: 6
- Watchers: 1
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-blazingly-fast - divisors - A blazing fast Rust library to find all divisors of a natural number. This library works with u8, u16, u32, u64, u128 and usize types. (Rust)
README
# Divisors
A blazing fast Rust library to find all divisors of a natural number. This library works with u8, u16, u32, u64, u128 and usize types.
## Example
``` Rust
use std::time::{Instant};fn main() {
let n: u128 = 934832147123321;
println!("finding divisors of {}", n);
let start_time = Instant::now();
let v = divisors::get_divisors(n);
println!("time = {:?}, divisors = {:?}", start_time.elapsed(), v);
}
/* Output:
finding divisors of 934832147123321
time = 663.484µs, divisors = [19, 5011, 63397, 95209, 154877, 1204543, 2942663, 317682367, 776088647, 6035964973, 9818737169, 14745684293, 186556006211, 49201691953859]
*/
```
## Usage
Add this to your `Cargo.toml`:
```toml
[dependencies]
divisors = "0.2.1"
```## Documentations
```sh
cargo doc --no-deps --open
```
[link](https://docs.rs/divisors/)## Benchmarks
```sh
cargo bench
```## Test
```sh
cargo test
```## Example
```sh
cargo run --release --example example
```
## License
MIT.