private static int greatestCommonDivisor(int number1, int number2) { int remainder = number1 % number2; while (remainder != 0) { number1 = number2; number2 = remainder; remainder = number1 % number2;
private static int greatestCommonDivisor(int u, int v) {      if (u>0) { u=-u; } if (v>0) { v=-v; }  int k=0; while ((u&1)==0 && (v&1)==0 && k<31) { u/=2; v/=2; k++;
    private static int greatestCommonDivisor(int number1, int number2) {        int remainder = number1 % number2;        while (remainder != 0) {            number1 = number2;            number2 = remainder;            remainder = number1 % number2;        }        return number2;    }