Originally posted by: txrandom
I can write a small program to do it if you are interested. It uses Leibnez Series.
/*
* Main.java
*
* Created on December 14, 2006, 8:15 PM
*
* To change this template, choose Tools | Template Manager
* and open the template in the editor.
*/
import java.lang.Math;
/**
*
* @author Bonsai
*/
public class Main {
/** Creates a new instance of Main */
public Main() {
}
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
Object number = Math.PI;
System.out.println(number);
// TODO code application logic here
}
}
compile:
run:
3.141592653589793
BUILD SUCCESSFUL (total time: 3 seconds)
Or in caase yor cheap calculator doesn't have a pi key, the quick & simple approximation I use is:Originally posted by: Don Rodriguez
Hit the Pi key on a calculator.
Originally posted by: BrokenVisage
Originally posted by: Aflac
Originally posted by: Shawn
22/7
Might want to try that in a calculator.
Yeah, pretty sure that's another non-repeating, non-terminating decimal.. it's just very close to pi.
Originally posted by: alfa147x
Here I just made an application that prints out math.pi
here is the code:
Code:/* * Main.java * * Created on December 14, 2006, 8:15 PM * * To change this template, choose Tools | Template Manager * and open the template in the editor. */ import java.lang.Math; /** * * @author Bonsai */ public class Main { /** Creates a new instance of Main */ public Main() { } /** * @param args the command line arguments */ public static void main(String[] args) { Object number = Math.PI; System.out.println(number); // TODO code application logic here } }
the output is:
compile:
run:
3.141592653589793
BUILD SUCCESSFUL (total time: 3 seconds)
Originally posted by: tfinch2
Originally posted by: alfa147x
Here I just made an application that prints out math.pi
here is the code:
Code:/* * Main.java * * Created on December 14, 2006, 8:15 PM * * To change this template, choose Tools | Template Manager * and open the template in the editor. */ import java.lang.Math; /** * * @author Bonsai */ public class Main { /** Creates a new instance of Main */ public Main() { } /** * @param args the command line arguments */ public static void main(String[] args) { Object number = Math.PI; System.out.println(number); // TODO code application logic here } }
the output is:
compile:
run:
3.141592653589793
BUILD SUCCESSFUL (total time: 3 seconds)
You are teh code genius.
