The gcd( Command

Command Summary

Finds the greatest common divisor of two values.

Command Syntax

gcd(value1, value2)

Menu Location


  1. MATH to access the math menu.
  2. RIGHT to access the NUM submenu.
  3. 9 to select gcd(, or use arrows.

Calculator Compatibility


Token Size

2 bytes

The gcd( command returns the greatest common divisor (GCD) of two nonnegative integers. It also works on lists.

     {3 6}
     {2 4}

Advanced Uses

A gcd( command can be nested inside another gcd( command to compare up to four numbers.

Error Conditions

  • ERR:DIM MISMATCH is thrown if the arguments are two lists that don't have the same number of elements.
  • ERR:DOMAIN is thrown if the arguments aren't positive integers (or lists of positive integers) less than 1e12.

Related Commands


Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-Noncommercial-No Derivative Works 2.5 License.