public static double getPi(){
double sum=2;
int n=1;
int m=3;
double t=2;
// 1e-15 precision
while(t>1e-15){
t=t*n/m;
sum=sum+t;
n++;
m+=2;
}
return sum;
}