greatestCommonDivisor function

int greatestCommonDivisor(
  1. int a,
  2. int b
)

Returns the greatest common divisor (gcd) of two integers using Euclid's algorithm.

Implementation

int greatestCommonDivisor(int a, int b) => a.gcd(b);