identification division.
program-id. exponentiation.
* die reelle Exponentialfunktion
* r = e ** x
author. "JD".
date-written. 25.10.2004.
date-compiled.
data division.
working-storage section.
77 i pic 9(8).
77 s pic S9(8)V9(8).
77 f pic S9(8)V9(8).
77 diff pic S9(8)V9(8).
78 delta value 0.0001.
linkage section.
77 x pic S9(4)V9(4).
77 r pic S9(8)V9(8).
procedure division using x r.
* computes ??
move 0 to r
move 1 to diff
move 1 to f.
perform varying i from 1 by 1
until f*f < delta
or i >2000
add f to s
multiply f by x
divide i into f
end-perform.
end-program exponentiation.
¤ Dauer der Verarbeitung: 0.21 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.
|