@pengzhanbo/utils - v3.4.1
    Preparing search index...

    Function gcd

    • Greatest Common Divisor (GCD) of two numbers

      计算两个数的最大公约数

      Parameters

      • a: number

        The first number. 第一个数

      • b: number

        The second number. 第二个数

      Returns number

      The greatest common divisor of a and b. a和b的最大公约数

      gcd(12, 8) // => 4
      gcd(17, 13) // => 1
      gcd(0, 5) // => 5