Identification Division.
Program-Id. kettendivision.
Author. "Leutbecher".
* Zahlentheorie S. 23
* unvollständig !!!
Data Division.
Working-Storage Section.
77 k pic S9(8).
77 p-1 pic S9(8).
77 p-2 pic S9(8).
77 q-1 pic S9(8).
77 q-2 pic S9(8).
77 a pic S9(8).
77 ak pic S9(8).
77 pk pic S9(8).
77 qk pic S9(8).
Linkage Section.
77 r0 pic S9(8).
77 r1 pic S9(8).
77 rk pic S9(8).
Procedure Division using r0 r1 returning rk.
move 0 to k p-2 q-1
move 1 to p-1 q-2
perform until rk<=0
move function max(a*rk) to ak
compute pk=ak*pk-1+pk-2
compute qk=ak*qk-1+qk-2
compute rk= rk+2 -ak*rk+1
add 1 to k
end-perform
* now rk = ggt(r0,r1) and pk-1/qk-1 = r0/r1
End-Program kettendivision.
¤ Dauer der Verarbeitung: 0.0 Sekunden
(vorverarbeitet)
¤
|
schauen Sie vor die Tür
Fenster
Die Firma ist wie angegeben erreichbar.
Die farbliche Syntaxdarstellung ist noch experimentell.
|