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

Quelle  simpson.cob   Sprache: Cobol

 

       Identification Division.
       Program-Id. simpson.
       Data Division.
       Working-Storage Section.
         77 w     pic 9(4)V9(2).
         77 i     pic 9(4).
       Linkage Section.
         77 a     pic 9(4)V9(2).
         77 b     pic 9(4)V9(2).
         77 n     pic 9(4).
         77 r     pic 9(4)V9(2).
         77 p1    pic 9(4)V9(2).
         77 p2    pic 9(4)V9(2).
         77 p3    pic 9(4)V9(2).
         77 r1    pic 9(4)V9(2).
         77 r2    pic 9(4)V9(2).
         77 r3    pic 9(4)V9(2).
       Procedure Division using a b n r.
        move 0 to r
        compute w=(b-a)/n
        perform varying i from 1 until i=n
          compute p1=a+(i-1)*w
          call f using p1 r1
          compute p2=a-w/2+i*w
          call f using p2 r2
          compute p3=a+i*w
          call f using p3
          compute r=r+w*(r1+4*r2+r3)/6
        end-perform
       End-Program simpson.  

Messung
CHZG
869610093

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

*© Formatika GbR, Deutschland