Calculate GCD (JavaScript)

Program

x:
y:
gcd(x, y):

Description

This JavaScript program calculates the greatest common divisor (GCD) of the given integers. The numbers must be between 0 and 253.

The algorithm being used is the classic GCD algorithm by Euclid, which is very fast.

The source code is available.

Examples

Related

More info