powered by
Greatest common divisor or factor for all elements of a positive-integer-valued vector.
gcd(x)
a numeric constant containing the greatest common divisor.
a numeric vector consisting of at least two positive integer values.
The gcd is calculated using the Euclidean algorithm applied to successive pairs of the elements of x.
x <- c(81, 57, 333) gcd(x)
Run the code above in your browser using DataLab