identificationdivision. program-id. divfast. * aus Wirth, systematisches Programmieren p. 43 * vorsichtig: q ist der Zähler und r das Ergebnis author. "JD". date-written. 25.10.2004. date-compiled. datadivision. working-storagesection.
77 q pic 9(4).
77 w pic 9(4). linkagesection.
77 x pic 9(4).
77 y pic 9(4).
77 r pic 9(4). proceduredivisionusing x y r. * computes x / y move x to r. move 0 to q move y to w * invariant w = 2**n * y > x performuntil w = y withtestafter * q * w + r = x, r >= 0 multiply 2 by q divide 2 into w if w <= r then subtract r from w add 1 to q end-if end-perform. * q * y + r = x 0 <= r < y q = x div y end-program divfast.
¤ 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.