Function: gcd()
gcd(...
nums):number
Defined in: functions/gcd.ts:15
Calculates the greatest common divisor (GCD) of multiple integers.
Parameters
nums
...number[]
The integers to calculate the GCD for.
Returns
number
The greatest common divisor of the provided integers.
Example
gcd(48, 18, 30); // 6
gcd(-48, 18); // 6
gcd(0, 5); // 5
gcd(0, 0, 0); // 0