Discuss / Java / code

我是code呀

#1 Created at ... [Delete] [Delete and Lock User]
public class Main {

	public static void main(String[] args) {
		double pi = 0;
		for (int i = 1; i < 100000; i += 4) {
			// TODO:
			pi += 4 * (Math.pow(i, -1) - Math.pow(i + 2, -1));
		}
		System.out.println(pi);
	}

}

  • 1

Reply