Function GCD

  • Calculates the greatest common divisor (GCD) of two numbers. *@param {number} a - The first number. *@param {number} b - The second number. *@returns {number} The GCD of the two numbers. *

    Parameters

    • a: number
    • b: number

    Returns number

    Example

    *    GCD(12, 18);    // Returns 6
    * GCD(24, 36); // Returns 12

Generated using TypeDoc