求解,这是什么原理???请大咖们解答,谢谢!!!
public class Main {public static void main(String[] args) {
double pi = 0;
int count = 0;
for (int i = 1; i < 100000; i += 2) {
// TODO:
pi = pi + 4 * (Math.pow(-1, count) / i);
count ++ ;
}
System.out.println(pi);
}
} 格里高利公式
页:
[1]