identificationdivision. program-id. sqrt-real. * aus Wirth, systematisches Programmieren p. 61 author. "JD". date-written. 11.9.2005. date-compiled. datadivision. working-storagesection.
77 a pic 9(4)V9(4).
77 c pic 9(4)V9(4).
77 eps pic 9(4)V9(4) value 0.001. linkagesection.
77 x pic 9(4)V9(4).
77 r pic 9(4)V9(4). proceduredivisionusing x r. * computes x * (1-) <= a**2 < x move a to x compute c = 1 - x. performuntil c <= eps * invariant a**2 = x * (1 - c), c >= 0 compute a = a*(1+0.5*c) compute c = c*c*(0.75+0.25*c) end-perform. move x to r. end-program sqrt-real.
¤ Dauer der Verarbeitung: 0.10 Sekunden
(vorverarbeitet)
¤
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.