function computeGCD(a, b) {
  if (!Number.isInteger(a) || !Number.isInteger(b)) {
    throw new Error('Parameters must be integer numbers');
  }

  var r;
  while (b != 0) {
    r = a % b;
    a = b;
    b = r;
  }
  return (a < 0) ? -a : a;
}
// Computes greatest common divisor of a and b using Euclid's algorithm
Computes greatest common divisor of a and b using Euclid's algorithm
Computes greatest common divisor of a and b using Euclid ' s algorithm
function computeGCD(a, b) {
  if (!Number.isInteger(a) || !Number.isInteger(b)) {
    throw new Error('Parameters must be integer numbers');
  }
  var r;
  while (b != 0) {
    r = a % b;
    a = b;
    b = r;
  }
  return (a < 0) ? -a : a;
}
function computeGCD ( a , b ) { if ( ! Number . isInteger ( a ) || ! Number . isInteger ( b ) ) { throw new Error ( 'Parameters must be integer numbers' ) ; } var r ; while ( b != 0 ) { r = a % b ; a = b ; b = r ; } return ( a < 0 ) ? - a : a ; }
Computes greatest common divisor of a and b using Euclid's algorithm
Computes greatest common divisor of a and b using Euclid ' s algorithm