identificationdivision. program-id. gcd. author. Bergeretti/Carre. * extended euclids algorithm date-written. January 1985. date-compiled. datadivision. working-storagesection. 77 a1 pic9(4). 77 a2 pic9(4). 77 b1 pic9(4). 77 b2 pic9(4). 77 c pic9(4). 77 d pic9(4). 77 q pic9(4). 77 r pic9(4). 77 out pic9(4). linkagesection. 77 m pic9(4). 77 n pic9(4). 77 x pic9(4). 77 y pic9(4). 77 z pic9(4). proceduredivisionusing m, n, x, y, z. * m>=0, n>0 move0to a1 move1to a2 move1to b1 move0to b2 move m to c move n to d performuntil d = 0 * a1 * m + b1 * n = d * a2 * m + b2 * n = c * gcd(c,d) = gcde(m,n) compute q = c / d compute r = function mod(c, d) compute a2 = a2 - q * a1 compute b2 = b2 - q * b1 move d to c move r to d move a1 to r move a2 to a1 move r to a2 move b1 to r move b2 to b1 move r to b2 end-perform move c to x move a2 to y move b2 to z * x = gcd(m,n) = y * m + z*n compute out=y*m+z*n display"x="x" out="out end-program gcd.
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.11 Sekunden
(vorverarbeitet am 2026-06-11)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.