GCD(a, I)

Returns the greatest common divisor of an array of numbers. «a» should be an array of positive integers indexed by «I».

The greatest common divisor is the largest integer that divides evenly into all integers in «a».


M ▶
1 2 3
a ▻ 2297295 2457 10395
GCD(a,M) → 189
GCD( [23*5, 23*7, 23*9, 23*11] ) → 23


To use this function, you must add the following library to your model.

GCD function library.ana

See Also


You are not allowed to post comments.