求C语言一段小程序运行结果

double fx(double x){return exp(x);}
double intf(double (*f)(double),double a,double b,int n)
{
double sum,h;
int i;
h=(b-a)/n;
sum=(f(a)+f(b))/2.0;
for (i=1;i<n;i+=1){
sum+=f(a+h*i);
}
return sum*h;
}

int main(){printf("%f\n",intf(&fx,0.0,1.0,10));return 0;}

结果如图,求近似的结果以及分析过程啊
程序是求exp(x)从0到1上的积分,所以答案等于exp(1)-exp(0)=e-1
结果是1.719713,我是运行出来的