Small Rust library for calculating greatest common divisor crates.io/crates/gcd
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge pull request #6 from raidwas/patch-1

update docs

authored by

Corey Farwell and committed by
GitHub
ace6108d 3b143529

+7 -1
+7 -1
src/lib.rs
··· 2 2 3 3 pub trait Gcd { 4 4 /// Determine [greatest common divisor](https://en.wikipedia.org/wiki/Greatest_common_divisor) 5 - /// using the [Euclidean algorithm](https://en.wikipedia.org/wiki/Euclidean_algorithm) 5 + /// using [`gcd_binary`]. 6 + /// 7 + /// [`gcd_binary`]: #method.gcd_binary 6 8 /// 7 9 /// # Examples 8 10 /// ··· 16 18 /// assert_eq!(44, 2024u32.gcd(748)); 17 19 /// ``` 18 20 fn gcd(self, other: Self) -> Self; 21 + /// Determine [greatest common divisor](https://en.wikipedia.org/wiki/Greatest_common_divisor) 22 + /// using the [Binary GCD algorithm](https://en.wikipedia.org/wiki/Binary_GCD_algorithm). 19 23 fn gcd_binary(self, other: Self) -> Self; 24 + /// Determine [greatest common divisor](https://en.wikipedia.org/wiki/Greatest_common_divisor) 25 + /// using the [Euclidean algorithm](https://en.wikipedia.org/wiki/Euclidean_algorithm). 20 26 fn gcd_euclid(self, other: Self) -> Self; 21 27 } 22 28