/* mymath.cpp This file would contain the implementations of all the functions in our math library. */ int gcd(int a, int b) { // Uses Euclid's algorithm to compute the // greatest common denominator of a and b int larger, smaller; if (a > b) { larger = a; smaller = b; } else { larger = b; smaller = a; } int remainder = larger % smaller; if (remainder == 0) { return smaller; } else { return gcd(smaller, remainder); } }