From: hackbard Date: Wed, 5 Nov 2003 12:24:49 +0000 (+0000) Subject: integral-1_2.c added, rueckwearst rekursion (N...0) X-Git-Url: https://hackdaworld.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e0f00c13eac7c9f9ae735bb7928057fc1445b056;p=physik%2Fcomputational_physics.git integral-1_2.c added, rueckwearst rekursion (N...0) --- diff --git a/integral-1_2.c b/integral-1_2.c new file mode 100644 index 0000000..e49100b --- /dev/null +++ b/integral-1_2.c @@ -0,0 +1,28 @@ +#include +#include +#include + +int main(int argc,char **argv) { + double p_N; + double p; + int start; + int i,j; + + if(argc!=3) { + printf("usage: %s \n",argv[0]); + return 1; + } + + start=atoi(argv[1]); + p_N=atof(argv[2]); + + printf("debug: N=%d startwert=%f\n",start,p_N); + + for(i=start;i>=0;i--) { + p=(1/((double)i+1))*(M_E-p_N); + printf("p_%d = %f\n",i,p); + p_N=p; + } + + return 1; +}