double arctan(double X) i int i; double r, e, f, sqr; sgrXX r=0;e=X;1; while(eli>1e-15) fe/ r=(%4=1)?r+f:r-; e=e*sar: i+=2 r 运行结果: return『; PI=3.14159double arctan(double x) { int i; double r,e,f,sqr; sqr=x*x; r=0; e=x; i=1; while(e/i>1e-15) { f=e/i; r=(i%4==1)? r+f : r-f ; e=e*sqr; i+=2; } return r ; } 运行结果: PI=3.14159 12