Options
All
  • Public
  • Public/Protected
  • All
Menu

External module "math/base/special/gcd/docs/types/index.d"

Index

Functions

Functions

Export assignment gcd

  • gcd(a: number, b: number): number
  • Computes the greatest common divisor (gcd).

    Notes

    • If both a and b are 0, the function returns 0.
    • Both a and b must have integer values; otherwise, the function returns NaN.

    Parameters

    • a: number

      integer

    • b: number

      integer

    Returns number

    greatest common divisor

    Example

    var v = gcd( 48, 18 );
    // returns 6

    Example

    var v = gcd( 3.14, 18 );
    // returns NaN

    Example

    var v = gcd( NaN, 18 );
    // returns NaN