Date: Sun, 12 Feb 95 19:11:44 +0000 Here is a transcription into plain ASCII text of algorithm #7 from Collected Algorithms from CACM. jr Jose R. Valverde European Bioinformatics Institute txomsy@ebi.ac.uk --------------------------------------------------------------------------- 7. EUCLIDIAN ALGORITHM Robert Claussen General Electric Co., Cincinnati 15, Ohio comment Every pair of numbers a, b, not both zero have a positive greatest common divisor: gcd; procedure EUC(a, b) =: (gcd) begin EUC: if (a = 0) begin gcd := b ; return end if (b = 0) begin gcd := a ; return end r2 := a r1 := b here: g := r2 / r1 comment Assumption is made that truncation takes place in the above statement; r := r2 - r1 * g if (r = 0) begin gcd := r1 ; return end begin r2 := r1 r1 := r go to here end integer (g) end