Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/Cobol/verschiedene-Autoren/Nissim-Francez/   (verschiedene Autoren Version 0.7©)  Datei vom 4.1.2008 mit Größe 560 B image not shown  

Quelle  francez-p62.cob   Sprache: Cobol

 

       Identification Division.
       Program-Id. francez-p62.
       Author. "Nissim Francez".
      * "aus Program Verification"  
       Data Division.
       Working-Storage Section.
         77 x    pic S9(8) comp-2.
         77 xn   pic S9(8) comp-2.
         77 te   pic S9(8) comp-2.
         77 eps  pic S9(2)V9(8)  value 0.00001.
       Linkage Section.
         77 a    pic S9(8) comp-2.
       Procedure Division using a.
        l0.
         display "start".
         move a to x
         move 1 to xn
        l.
         compute te=a - xn**2
         if function abs(te)>eps then
           compute xn=(a+xn)/(2*xn)
         else  
           go to le
         end-if.
         go to l.
        le.
         display "halt xn=" xn " x=" x
       End-Program francez-p62.

Messung
CHZG
919810096

¤ Dauer der Verarbeitung: 0.28 Sekunden  ¤

*© Formatika GbR, Deutschland