Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class PiBerechnenAnwendung {
- public static void main(String args[]){
- int k;
- k = 0;
- double pi;
- BerechnePI(pi, k);
- System.out.println(pi);
- private static void BerechnePI(double pi, int k) {
- k++;
- while(k<=3)
- pi=(1/16^k)*(((4.0/(8.0*k+1.0))-(2.0/(8.0*k+4.0))-(1.0/(8.0*k+5.0))-(1.0/(8.0*k+6.0))));
- System.out.println(pi);
- }
- }
- }
Add Comment
Please, Sign In to add comment