Weiqi Gao reminded me that today is “PI Day”; that along wouldn’t warrant a post here, but the Java snippet for estimating the value of PI rather inefficiently, did:
[weiqi@gao] $ cat PI.java
public class PI {
public static void main(String[] args) {
double sum = 0.0d;
for (int i = 1; i < 64000; i++) {
sum += 6.0/(i*i);
}
System.out.println(Math.sqrt(sum));
}
}
[weiqi@gao] $ [...]