projects
/
physik
/
computational_physics.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
added runge kutta example
[physik/computational_physics.git]
/
integral-1_2.c
diff --git
a/integral-1_2.c
b/integral-1_2.c
index
e49100b
..
c286121
100644
(file)
--- a/
integral-1_2.c
+++ b/
integral-1_2.c
@@
-6,7
+6,7
@@
int main(int argc,char **argv) {
double p_N;
double p;
int start;
double p_N;
double p;
int start;
- int i
,j
;
+ int i;
if(argc!=3) {
printf("usage: %s <start> <startwert>\n",argv[0]);
if(argc!=3) {
printf("usage: %s <start> <startwert>\n",argv[0]);
@@
-16,8
+16,6
@@
int main(int argc,char **argv) {
start=atoi(argv[1]);
p_N=atof(argv[2]);
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);
for(i=start;i>=0;i--) {
p=(1/((double)i+1))*(M_E-p_N);
printf("p_%d = %f\n",i,p);