正在加载图片...
double arctan(double x) I int fenmu; double sum, fenzi, item, sqr; sgrXX sum=0: fenzjx. fenmuE1 while(fenzi/fenmu>le-15) itemEfenzifenmu sum =(fenmu/4==1)? r+item r-item fenzi=fenzi*sqr; fenmu+=2; 运行结果: return sum PI=3.14159double arctan(double x) { int fenmu; double sum,fenzi,item,sqr; sqr=x*x; sum=0; fenzi=x; fenmu=1; while(fenzi/fenmu>1e-15) { item=fenzi/fenmu; sum = (fenmu%4==1)? r+item : r - item ; fenzi=fenzi*sqr; fenmu+=2; } return sum ; } 运行结果: PI=3.14159 13
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有