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

Quelle  reciproke.cob   Sprache: Cobol

 

       identification division.
       program-id. recip.
      *  aus Wirth, systematisches Programmieren p. 62 
       author. "JD".
       date-written. 15.8.2007.
       date-compiled.
       data division.
       working-storage section.
       77 c   pic 9(4)V9(4).
       77 eps pic 9(4)V9(4) value 0.001.
       linkage section.
       77 x   pic 9(4)V9(4).
       77 a   pic 9(4)V9(4).
       procedure division using x returning a.
      * computes 1/x
         move 1 to a
         subtract x from 1 giving c
         perform until c<=eps
      *    a*x=1-c, 0<abs(c)<1  
           compute a = a*(1+c)
           multiply c by c
         end-perform.
      *  (1-eps)/x<=a<1/x.
        end-program recip.

Messung
CHZG
9310010097

¤ Dauer der Verarbeitung: 0.7 Sekunden  (vorverarbeitet am  2026-11-24) ¤

*© Formatika GbR, Deutschland