Identification Division.
Program-Id. francez-p62.
Author. "Nissim Francez".
* "aus Program Verification"
Data Division.
Working-Storage Section.
77 x pic S9(8) comp-2.
77 xn pic S9(8) comp-2.
77 te pic S9(8) comp-2.
77 eps pic S9(2)V9(8) value 0.00001.
Linkage Section.
77 a pic S9(8) comp-2.
Procedure Division using a.
l0.
display "start".
move a to x
move 1 to xn
l.
compute te=a - xn**2
if function abs(te)>eps then
compute xn=(a+xn)/(2*xn)
else
go to le
end-if.
go to l.
le.
display "halt xn=" xn " x=" x
End-Program francez-p62.
¤ Dauer der Verarbeitung: 0.14 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.
|