#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

#406 in Math

48 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