Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/Delphi/Bille 0.71/__history/     Datei vom 17.0.2013 mit Größe 36 kB image not shown  

Quelle  squareroot.cob   Sprache: Cobol

 

       identification division.
       program-id. squareroot.
      * Autor Jens-D. Doll
      * Dies ist ein Iterationsverfahren
      * mit Limes Wurzel n
      * Es konvergiert nicht immer!!
       author. "JD".
       date-written. 27.12.2006.
       date-compiled.
       data division.
       working-storage section.
         77 u         pic 9(4)V9(8).
         77 m         pic 9(4)V9(8).
         77 o         pic 9(4)V9(8).
         77 n         pic 9(4).
       procedure division.
         display "start"
         accept n
         move 0 to u 
         move n to o
         compute m = (o -u)/2
         perform until m * m = n
           if m*m > n then
             move m to o
           else
             move m to u
           end-if
           compute m = (o -u)/2
         end-perform
         display "done, Wurzel("n")="m.
        end-program squareroot.

Messung
CHZG
9010010096

¤ Dauer der Verarbeitung: 0.0 Sekunden  (vorverarbeitet am  2026-11-25) ¤

*© Formatika GbR, Deutschland