GCD

The GCD function returns the Greatest Common Divisor of two numbers.

Syntax

GCD(
    number1,
    number2
)

Parameters
  • number1: First number to consider.
  • number2: Second number to consider.
Returned value

The GCD function returns an integer.

Additional Information

The GCD function requires exactly two arguments.

If any of the arguments is not a number or is a value less than zero, the function will return an error message. If any of the arguments is greater than 2^53, the function will also return an error message.

The number 1 divides any other number and a prime number will only have 1 and itself as integer divisors.

If one of the arguments is True, the result will always be 1. If it is False, the result will be the value of the other argument (if one argument is True and the other is False, 1 is returned).

Examples

This example calculates the greatest common divisor of the numbers 18 and 9 (which returns a 9):

GCD function. Example of use

Related functions
Category
Mathematical and trigonometric
Submitted by admin on Tue, 12/04/2018 - 12:28