@@ -0,0 +1,553 @@
+package ch.obermuhlner.math.big.example;%0D%0A%0D%0Aimport java.math.BigDecimal;%0D%0Aimport java.math.MathContext;%0D%0A%0D%0Aimport ch.obermuhlner.math.big.BigDecimalMath;%0D%0A%0D%0A/**%0D%0A * This example shows how to calculate pi with different precisions.%0D%0A */%0D%0Apublic class PiExample %7B%0D%0A%0D%0A%09public static void main(String%5B%5D args) %7B%0D%0A%09%09for (int precision = 1; precision %3C 2000; precision++) %7B%0D%0A%09%09%09MathContext mathContext = new MathContext(precision);%0D%0A%09%09%09BigDecimal pi = BigDecimalMath.pi(mathContext);%0D%0A%09%09%09System.out.printf(%22%254d : %25s%5Cn%22, precision, pi.toString());%0D%0A%09%09%7D%0D%0A%09%7D%0D%0A%7D%0D%0A

add PiExample