identificationdivision. program-id. pibow. * Berechnung von PI nach der Formel * U=2*PI*r * am Viertelkreis author. "JD". date-written. 15.8.2007. date-compiled. datadivision. working-storagesection. 77 n pic9(4). 77 i pic9(4). 77 c pic9(4)V9(4). 77 u pic9(4)V9(4). 77 xi pic9(4)V9(4). 77 lyi pic9(4)V9(4). 77 yi pic9(4)V9(4). 77 bi pic9(4)V9(4). 78 eps pic9(4)V9(4) value0.001. 77 x pic9(4)V9(4). 77 a pic9(4)V9(4). linkagesection. 77 pi pic9(4)V9(4). proceduredivisionreturning pi. * computes pi = summ of all secants on the * quarter circle, xi = breadth, yi=height compute n=1/eps move0to u move1to lyi performvarying i from1by1until i=n compute xi=i*eps compute x=1-xi*xi perform root move a to yi compute bi=(yi-lyi)*eps compute x=bi perform root add a to u end-perform add1to n compute pi=4*u stoprun.
root. move x to a subtract x from1giving c performuntil c<=eps * a*a=x*(1-c), c>=0 compute a = a*(1+0.5*c) compute c = c*c*(0.75+0.25*c) end-perform. * x*(1-eps)/x<=a*a<x. end-program pibow.
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.8 Sekunden
(vorverarbeitet am 2026-06-07)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.