gcd

compute the greatest common divisor using euclid's algorithm