gcd
The greatest common divisor function.
Syntax
-
gcd(n[, ...])
-
n
and...
are integers
-
Description
gcd(n[, ...])
is the largest positive integer that divides each of the arguments. If all arguments are 0
, the result is 0
.
Examples
gcd(18, 24)
6
gcd(605448523680, 5919461888340)
420420
gcd(50, 25, 75)
25
gcd(50, 25, 75, −10, 0)
5