Identification Division.
Program-Id. divisions.
Author. "Leutbecher".
* Zahlentheorie S. 56
Data Division.
Working-Storage Section.
77 e pic S9(8).
77 y pic S9(8).
Linkage Section.
77 x pic S9(8).
77 n pic S9(8).
77 p pic S9(8).
Procedure Division using x n returning p.
* computes p = x**n
move n to e
move x to y
move 1 to p
perform until e <= 0
if function mod(e, 2)=1 then
multiply p by y
end-if
multiply y by y
divide 2 into e
end-perform
* now y = x ** n
End-Program divisions.
¤ Dauer der Verarbeitung: 0.16 Sekunden
(vorverarbeitet)
¤
|
Haftungshinweis
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 ist noch experimentell.
|