Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/Cobol/verschiedene-Autoren/Zing-COBOL/   (verschiedene Autoren Version 0.7©)  Datei vom 4.1.2008 mit Größe 1 kB image not shown  

SSL divfast.cob  Sprache: unbekannt

 
       identification division.
       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.
       data division.
       working-storage section.
       77 q pic 9(4).
       77 w pic 9(4).
       linkage section.
       77 x   pic 9(4).
       77 y   pic 9(4).
       77 r   pic 9(4).
       procedure division using x y r.
      * computes x / y
         move x to r.
         move 0 to q
         move y to w
      * invariant w = 2**n * y > x   
         perform until w = y with test after
      *   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.

Messung
CHZG
979810098

[Verzeichnis aufwärts0.228unsichere VerbindungÜbersetzung europäischer Sprachen durch Browser2026-11-25]