Skip to content

GCD

GCD(n1, n2, ...)

computes the greatest common divisor of the given integers.

See

Examples

>> GCD(20, 30)
10
>> GCD(10, y)
GCD(10, y)

GCD is Listable:

>> GCD(4, {10, 11, 12, 13, 14})
{2, 1, 4, 1, 2}

LCM

Implementation status

  • ✅ - full supported

Github