b-integer-gcd

▸ function bGcdInt (a: bigint, b: bigint): bigint

Defined in gcd/bigint/b-integer-gcd.ts:7

Computes and returns the greatest common divisor of two integers a and b, using the Euclidean Algorithm.

Parameters:

NameType
abigint
bbigint

Returns: bigint


▸ function bGcdInts (vals: bigint[]): bigint

Defined in gcd/bigint/b-integer-gcd.ts:38

Naively computes and returns the greatest common divisor of 2 or more integers by taking each integer in turn and calculating the GCD of that integer and the previously calculated GCD (where the first GCD is simply taken as the first number).

Parameters:

NameTypeDescription
valsbigint[]the integers for which the GCD is to be calculated

Returns: bigint