Skip to main content

gcd ()

Returns the Greatest Common Divisor (GCD) of a set of numbers.

Parameters​

$numbers
The numbers for which to calculate the greatest common divisor.
Type
ArgList<Number>

Return Value​

Number
The number that is the GCD of the given set of numbers.

Example​

@use '@sass-fairy/math';

@debug math.gcd(8, 12, 20);
// 4

@debug math.gcd(24, 36, 48);
// 12