关于#c语言#的问题,好像是溢出了

题目是:根据下式求π的近似值,直到最后一项小于给定精度eps,
​​​π/2=1+1/3+2!/(35)+3!/(357)+4!/(3579)+...​​


#include<math.h> 
#include <stdio.h>
double fact(int n);
int main(){
    int flag,mother,a;
      double i,eps,item,sum,num,x;
   scanf("%le", &eps);
      i=3.0;
      a=1;
      mother=1;
    item=1.0;
      sum=1;
      do{
      mother=mother*i;
      item=fact(a)/mother;
      x=item/1.0;
      a++;
      i=i+2;
      sum=sum+item;
            printf("item = %lf\n",x);
      }while(item>= eps);
    num=sum*2;
      printf("PI = %.5f",num);
      return 0;
}
double fact(int n)
{
    int s;
    double result;
    result = 1;
    for(s=1;s<=n;s++){
        result = result*s;
    }    
    return result;
}

我定义了一个函数,然后累加

img


跑了一下发现会出现负数,结果也不对

mother 是 int 型,这个溢出了,改成 double 吧