?? rtnewt.cpp
字號:
double rtnewt(double x1, double x2,double xacc)
{
int jmax,j;
double temp1,f,df,dx;
jmax = 20;
temp1 = 0.5 * (x1 + x2);
for (j = 1; j<=jmax; j++)
{
funcd(temp1, f, df);
dx = f / df;
temp1 = temp1 - dx;
if ((x1 - temp1) * (temp1 - x2) < 0 )
{
cout<< "jumped out of brackets"<<endl;
return temp1;
_c_exit();
}
if (fabs(dx) < xacc)
{
return temp1;
_c_exit();
}
}
cout<< "rtnewt exceeding maximum iterations."<<endl;
return 1;
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -