简简单单的问题!求大神指点
这两个语句t=t*n/(2*n+1);与t*=n/(2*n+1);有何不同,为什么的出不同的结果?#include <stdio.h >
#include < conio.h >
#include <math.h >
double fun( double eps)
{
double s=1.0,t=1.0;
int n=1;
do
{
t=t*n/(2*n+1);
s+=t;
n++;
}while(t>=eps);
return 2*s;
}
void main ()
{
double x;
printf ("Input eps : ") ;
scanf("%lf",&x);
printf("\neps =%lf, PI =%lf\n",x, fun(x));
}