Skip to main content

function

gcd

gcd(m: Int, n: Int, /) -> Int

Compute the greatest common divisor of two integers.

Args:

  • m (Int): The first integer.
  • n (Int): The second integrer.

Returns:

The greatest common divisor of the two integers.

gcd(s: Span[Int, is_mutable, lifetime], /) -> Int

Computes the greatest common divisor of a span of integers.

Args:

  • s (Span[Int, is_mutable, lifetime]): A span containing a collection of integers.

Returns:

The greatest common divisor of all the integers in the span.

gcd(l: List[Int], /) -> Int

Computes the greatest common divisor of a list of integers.

Args:

  • l (List[Int]): A list containing a collection of integers.

Returns:

The greatest common divisor of all the integers in the list.

gcd(*values: Int) -> Int

Computes the greatest common divisor of a variadic number of integers.

Args:

  • *values (Int): A variadic list of integers.

Returns:

The greatest common divisor of the given integers.