greatestCommonDivisor function

int greatestCommonDivisor (int a, 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);