Class Pi


  • public class Pi
    extends Object
    Computations of Pi = 3.1415... to arbitrary precision.
    Author:
    Tilman Neumann
    • Constructor Detail

      • Pi

        public Pi()
    • Method Detail

      • pi

        public static BigDecimal pi​(Scale scale)
        Compute Pi using the approximation formula found by Plouffe and the Borwein brothers also used in mpfr. The result is accurate to at least scale decimal after-floating point digits.
        Parameters:
        scale - Wanted precision in decimal after-floating point digits
        Returns:
        PI = 3.1415...
      • main

        public static void main​(String[] argv)
        Test.
        Parameters:
        argv - command line arguments, ignored