public class Main { public static void main(String[] args) { double pi = 0; double temp = 0; for (int i=0;i<10000000;i++) { // TODO temp += Math.pow(-1,i)*(1.0/(2.0*i+1.0)); } pi = 4*temp; System.out.println(pi); } }
Sign in to make a reply
Lucibriel