MutableBigInteger hybridGCD(MutableBigInteger b){
  MutableBigInteger a=this;
  MutableBigInteger q=new MutableBigInteger();
  while (b.intLen != 0) {
    if (Math.abs(a.intLen - b.intLen) < 2)     return a.binaryGCD(b);
    MutableBigInteger r=a.divide(b,q);
    a=b;
    b=r;
  }
  return a;
}

MutableBigInteger hybridGCD ( MutableBigInteger b ) { MutableBigInteger a = this ; MutableBigInteger q = new MutableBigInteger ( ) ; while ( b . intLen != 0 ) { if ( Math . abs ( a . intLen - b . intLen ) < 2 ) return a . binaryGCD ( b ) ; MutableBigInteger r = a . divide ( b , q ) ; a = b ; b = r ; } return a ; }
calculate gcd of this and b . this and b are changed by the computation .
