用二分法和迭代法求e^x+10*x-2=0方程的解

主要運用循環whileweb #include<stdio.h> #include<math.h> double erfenfa() {double a=1,b=0,c; while(fabs(a-b)>=5e-4) {c=(a+b)/2.0; if((exp(c)+10*c-2)==0) return c; if((exp(a)+10*a-2)*(exp(c)+10*c-2)<0)
相關文章
相關標籤/搜索