math.gcd

Full name
math.gcd
Library
math
Syntax

math.gcd(*integers)

Description

The math.gcd (Greatest Common Divisor) function returns the greatest common divisor of the integers included as arguments.

Parameters
  • integers: Integer numbers whose greatest common divisor is to be obtained.
Result

The result returned by the math.gcd function is an integer.

Examples

We can obtain the greatest common multiple of the numbers 286 and 52 with the following code:

math.gcd(286, 52)

26

Submitted by admin on Wed, 01/20/2021 - 15:59