用c语言求sinx近似值

日期:2018-02-10 21:04:48 人气:2

用c语言求sinx近似值

int n=1,count=1; float x; double sum,term; scanf("%f",&x); sum=x; term=x; do{ term = -term*x*x/((n+1)*(n+2)); //改成这个,不要 count 和 power sum +=term; n+=2; } while(fabs(term) >=1e-5);
    A+
热门评论