The GCD function returns the Greatest Common Divisor of two numbers.
GCD(
number1,
number2
)
- number1: First number to consider.
- number2: Second number to consider.
The GCD function returns an integer.
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).
This example calculates the greatest common divisor of the numbers 18 and 9 (which returns a 9):