diff -r f40c792c9334 -r a7f8ce5aa858 src/miscallenous.cpp --- a/src/miscallenous.cpp Tue Feb 16 02:11:33 2016 +0200 +++ b/src/miscallenous.cpp Tue Feb 16 16:28:44 2016 +0200 @@ -94,26 +94,22 @@ int gcd (int a, int b) { - if (a > 0 and b > 0) + while (b != 0) { - while (a != b) - { - if (a < b) - b -= a; - else - a -= b; - } + int temp = a; + a = b; + b = temp % b; } return a; } -void simplify (int& numer, int& denom) +void simplify (int& numerator, int& denominator) { - int factor = gcd (numer, denom); - numer /= factor; - denom /= factor; + int factor = gcd(numerator, denominator); + numerator /= factor; + denominator /= factor; }