Skip to content

Commit 4fbcb11

Browse files
authored
Improved GCD documentation
1 parent 632919c commit 4fbcb11

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Sources/IntegerUtilities/GCD.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,10 @@ extension BinaryInteger {
1313

1414
/// The greatest common divisor of `a` and `b`.
1515
///
16-
/// If both inputs are zero, the result is zero.
16+
/// If both inputs are zero, the result is zero. If one input is zero, the
17+
/// result is the absolute value of the other input.
18+
///
19+
/// [wiki]: https://en.wikipedia.org/wiki/Greatest_common_divisor
1720
@inlinable
1821
public static func gcd(_ a: Self, _ b: Self) -> Self {
1922
var x = a.magnitude

0 commit comments

Comments
 (0)