klyn.math.Math.gcd
method
public static gcd<INT_TYPE extends AbstractInt>(first as INT_TYPE, second as INT_TYPE, values... as INT_TYPE) as INT_TYPE
Description

Computes the greatest common divisor of one or more integers.

The result is always non-negative.

Throws
  • ValueException if the final magnitude cannot fit in INT_TYPE.
Example
print(Math.gcd(42, 30))
print(Math.gcd(42, 30, 18))