Solves the GCD (Greatest Common Divisor) using the Euclidean Algorithm (Alternate alias of gcf)

gcd(1920, 1080); // 120
gcd(2, 2); // 2
  • Solves the GCF (Greatest Common Factor) using the Euclidean Algorithm

    Parameters

    • a: number
    • b: number

    Returns number

    gcf(1920, 1080); // 120
    gcf(2, 2); // 2