I have to write a program that displays the result of a mathematical approximation of Pi using textbooks guidelines, basic code
//Display Pi and variable of Pi
public class Pi {
public static void main(String[] args){
System.out.println(4*1.0-(1.0/3)+(1.0/5)-(1.0/7)+(1.0/9)-(1.0/11));
System.out.println(4*1.0-(1.0/3)+(1.0/5)-(1.0/7)+(1.0/9)-(1.0/11)+(1.0/13));
}
}
Output:
3.7440115440115442
3.8209346209346213
Am I on the right track?