Greatest_commmon_divisor
  • 27 May 2022
  • 1 Minute to read
  • Dark
    Light
  • PDF

Greatest_commmon_divisor

  • Dark
    Light
  • PDF

Article Summary

Given a list of numbers, calculates the greatest common divisor for them.

Function signature

GREATEST_COMMON_DIVISOR(list: Array) => Number
ParameterDescription
ListList of numeric values

Examples

FormulaReturn value
GREATEST_COMMON_DIVISOR([10, 100, 1000])10
GREATEST_COMMON_DIVISOR([14, 21, 42])7
GREATEST_COMMON_DIVISOR([12, 9, 15])3

Was this article helpful?

What's Next