/** * Return the greatest common divisor of two polynomials * * @param p polinomial * @param q polinomial * @return GCD(p, q) */ public static int gcd(int p, int q) { int a, b, c; a = p; b = q; while (b != 0) { c = remainder(a, b); a = b; b = c; } return a; }
/** * Return the greatest common divisor of two polynomials * * @param p polinomial * @param q polinomial * @return GCD(p, q) */ public static int gcd(int p, int q) { int a, b, c; a = p; b = q; while (b != 0) { c = remainder(a, b); a = b; b = c; } return a; }