# Calculate GCD (JavaScript)

## Program

## Description

This JavaScript program calculates the greatest common divisor (GCD) of the given integers. The numbers must be between 0 and 2^{53}. This program can be useful for simplifying fractions. The algorithm being used is the classic GCD algorithm by Euclid, which is very fast.

The source code is available for viewing.

## Examples

- gcd(0, 2) = 2.
- gcd(3, 5) = 1.
- gcd(24, 18) = 6.

## More info

- Wikipedia: Greatest common divisor
- Wikipedia: Euclidean algorithm
- MathWorld: Greatest Common Divisor