GCD

 

 Greatest common divisor.

  G = GCD(A,B) is the greatest common divisor of integers A and B.

  G = GCD(0,0) is 0 by convention; all other GCDs are positive integers.

 

 

  [G,C,D] = GCD(A,B) also returns C and D with G = A*C + B*D.