Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/Cobol/verschiedene-Autoren/Bauer F.L/   (verschiedene Autoren Version 0.7©)  Datei vom 27.1.2009 mit Größe 977 B image not shown  

Quelle  kette7.cob   Sprache: Cobol

 

       identification division.
      * aus dem Informatik-Spektrum
      * Beitrag von F.L. Bauer zu Kettenbrüchen
      * sqrt(3) = 1 + 1|/|1+ 1|/|2+ 1|/|1...  
       program-id. kette7.
       author. "JD".
       date-written. 27.2.2009.
       date-compiled.
       data division.
       working-storage section.
        78 max value 5.
        77 t pic 9(4)V9(8) comp-2.
        77 n pic 9(4).
        77 j pic 9(4).
        linkage section.
        77 r   pic 9(4)V9(8) comp-2.
       procedure division using r.
         move 0 to r
         move 2 to t
         perform varying n from 1 until n>max
           add t to r
           perform varying j from 1 until j>4
             if      j=1 then compute t=1/(1+1/t)
             else if j=2 then compute t=1/(1+1/t)
             else if j=3 then compute t=1/(1+1/t)
             else             compute t=1/(4+1/t)
           end-perform
         end-perform.
        end-program kette7.

Messung
CHZG
989910098

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

*© Formatika GbR, Deutschland