#multiple-values #gcd #greatest #divisor #calculate

gcdx

Calculate the greatest common divisor of multiple values

13 releases

0.2.3 Jun 2, 2024
0.2.2 Jun 2, 2024
0.1.9 Jun 2, 2024
0.1.8 Dec 12, 2023
0.1.4 Sep 2, 2023

#414 in Math

Download history 6/week @ 2024-08-26 5/week @ 2024-09-09 3/week @ 2024-09-16 75/week @ 2024-09-23 25/week @ 2024-09-30 17/week @ 2024-10-07 21/week @ 2024-10-14 6/week @ 2024-10-21 10/week @ 2024-10-28 25/week @ 2024-11-04 22/week @ 2024-11-18 80/week @ 2024-11-25 23/week @ 2024-12-02 111/week @ 2024-12-09

236 downloads per month
Used in 2 crates

MIT license

4KB
96 lines

gcdx-rs

Calculate the greatest common divisor of multiple values.

Rust

Example

use gcdx::gcdx;

fn main() {
    let v = vec![10, 9, 8, 7];
    let g = gcdx(&v).unwrap();
    println!("{}", g);
    assert_eq!(g, 1);
}

No runtime deps