怎么结果就差一点点,求大佬指点,要求输入0.005,结果是3.137130,但是我总是3.132157
double fun(double n){
double t=1.0,s=0.0;
int i=1;
while(t>n)
{
s+=t;
t=t*i/(i*2+1);
i++;printf("%lf\n",t);
}
s=s*2;
return s;
}
main()
{
double n;
scanf("%lf",&n);
printf("%lf",fun(n));
}