privatestaticvoidnOutput_PI(int a){// TODO Auto-generated method stubdouble pi =0;for(int i =1; i <= a; i++){
pi += Math.pow(-1, i +1)/(2* i -1);}
System.out.println(pi *4);}
原理分析一位数学家提供了我们计算圆周率的方法,源码 private static void nOutput_PI(int a) { // TODO Auto-generated method stub double pi = 0; for (int i = 1; i &lt;= a; i++) { pi += Math.pow(-1, i + 1) / (2 * i - ...