Crates.io | gcdx |
lib.rs | gcdx |
version | 0.2.3 |
source | src |
created_at | 2023-09-02 18:50:14.418069 |
updated_at | 2024-06-02 10:28:35.852063 |
description | Calculate the greatest common divisor of multiple values |
homepage | https://github.com/rikonaka/gcdx-rs |
repository | https://github.com/rikonaka/gcdx-rs |
max_upload_size | |
id | 961832 |
size | 5,692 |
Calculate the greatest common divisor of multiple values.
use gcdx::gcdx;
fn main() {
let v = vec![10, 9, 8, 7];
let g = gcdx(&v).unwrap();
println!("{}", g);
assert_eq!(g, 1);
}