#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

#407 in Math

Download history 9/week @ 2024-06-30 17/week @ 2024-07-07 9/week @ 2024-07-14 16/week @ 2024-07-21 43/week @ 2024-07-28 1/week @ 2024-08-04 1/week @ 2024-08-18 5/week @ 2024-08-25 2/week @ 2024-09-01 5/week @ 2024-09-08 3/week @ 2024-09-15 72/week @ 2024-09-22 27/week @ 2024-09-29 16/week @ 2024-10-06

119 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