To take the quizzes, you must log in.

*Username:***student***Password:***Formulas.1**You can view this site in

the language of your choice.

- gcd()
### gcd()

# gcd()

gcd(expr0,expr1) ⇒ number

Both expr0 and expr1 must be integer values.

The gcd() function returns the greatest common divisor of the two arguments as a number.

The greatest common divisor of two integers

*a*and*b*, which are not zero, is the largest positive integer that divides each integer. For example, the gcd of 8 and 12 is 4.If

*a*and/or*b*are real, the question gives unexpected results. For example, gcd(36.7,69.2) gives 3 which can be considered correct if real values are floored to integer values before gcd() is calculated, that is gcd(36.7,69.2) is interpreted as gcd(36,69) = 3. However, gcd(84,42.7) gives 42.7 which is somewhat unexpected.Use the calculator at the top right to find the greatest common divisor of two (or more) integers.

## GCF and LCM calculator

GCF and LCM Calculator## Examples

**Assignments****Function****Returned value**gcd(8,12) ⇒ 4 a=2;

b=4;

gcd(a*b,2*(a+b))⇒ 4 ## Reference