Quellcodebibliothek Statistik Leitseite products/sources/formale Sprachen/C/Lyx/images/   (Lyx Textverarbeitung ©)  Datei vom 26.9.1998 mit Größe 29 kB image not shown  

Quellcode-Bibliothek kette2.cob   Sprache: unbekannt

 
       identification division.
      * aus dem Informatik-Spektrum
      * Beitrag von F.L. Bauer zu Kettenbrüchen
      * sqrt(2) = 1 + 1|/|2+ 1|/|2+ 1|/|2...  
       program-id. kette2.
       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).
        linkage section.
        77 r   pic 9(4)V9(8) comp-2.
       procedure division using r.
         move 0 to r
         move 2 to t
         move 1 to n.
         perform varying n from 1 until n>max
           add t to r
           compute t=1/(2+1/t)
         end-perform.
        end-program kette2.

Messung V0.5
C=88 H=95 G=91

[ 0.10Quellennavigators  Projekt   ]