/**
 * 
 */
package mathsquared.resultswizard2;

/**
 * Contains methods for computing the greatest common divisor, least common multiple, and related quantities.
 * 
 * @author MathSquared
 * 
 */
public class GcdUtils {
    /**
     * Returns the greatest common divisor of two integers.
     * 
     * @param a the first integer
     * @param b the second integer
     * @return the GCD of a and b
     */
    public static int gcd (int a, int b) {
        int t = 0;
        while (b != 0) {
            t = b;
            b = a % b;
            a = t;
        }
        return a;
    }

    /**
     * Returns the least common multiple of two integers.
     * 
     * @param a the first integer
     * @param b the second integer
     * @return the LCM of a and b
     */
    public static int lcm (int a, int b) {
        return a / gcd(a, b) * b; // reordered to avoid overflow; correctly, a*b / gcd(a, b)
    }
}

@@ -528,13 +528,17 @@
 b = 
-a %25
+mod(a,
  b
+)
 ;%0A  
@@ -809,32 +809,32 @@
 int a, int b) %7B%0A
-
         return a
@@ -915,11 +915,498 @@
 b)%0A    %7D
+%0A%0A    /**%0A     * Computes the mathematical modulus of two numbers.%0A     * %0A     * %3Cp%3E%0A     * The Java %3Ccode%3E%25%3C/code%3E operator returns a result that adopts the sign of the dividend; however, a true mathematical modulus adopts the sign of the divisor. This method implements a mathematical modulus.%0A     * %3C/p%3E%0A     * %0A     * @param a the dividend%0A     * @param b the divisor%0A     * @return a mod b%0A     */%0A    public static int mod (int a, int b) %7B%0A        return ((a %25 b) + b) %25 b;%0A    %7D
 %0A%7D%0A

Add and use the mod method in GcdUtils