We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 632919c commit 4fbcb11Copy full SHA for 4fbcb11
Sources/IntegerUtilities/GCD.swift
@@ -13,7 +13,10 @@ extension BinaryInteger {
13
14
/// The greatest common divisor of `a` and `b`.
15
///
16
- /// If both inputs are zero, the result is zero.
+ /// 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
20
@inlinable
21
public static func gcd(_ a: Self, _ b: Self) -> Self {
22
var x = a.magnitude
0 commit comments