Method Gcd
Gcd(Int64, Int64)
Return the greatest common divisor of a
and b
,
consistently with System.Numerics.BigInteger.GreatestCommonDivisor(System.Numerics.BigInteger, System.Numerics.BigInteger)
.
NOTE: A greatest common divisor must be positive, but
2^64
cannot be expressed as a 0
and the GCD of
Declaration
public static long Gcd(long a, long b)
Parameters
Type | Name | Description |
---|---|---|
System.Int64 | a | |
System.Int64 | b |
Returns
Type | Description |
---|---|
System.Int64 |