Class Pi.RamanujanPiCalculator

    • Constructor Detail

      • RamanujanPiCalculator

        public RamanujanPiCalculator​(long precision,
                                     int radix)
                              throws ApfloatRuntimeException
        Construct a pi calculator with the specified precision and radix.
        Parameters:
        precision - The target precision.
        radix - The radix to be used.
        Throws:
        ApfloatRuntimeException
      • RamanujanPiCalculator

        protected RamanujanPiCalculator​(Pi.BinarySplittingPiCalculator calculator,
                                        long precision,
                                        int radix)
                                 throws ApfloatRuntimeException
        Construct a pi calculator with the specified binary splitting algorithm.
        Parameters:
        calculator - The binary splitting algorithm to be used.
        precision - The target precision.
        radix - The radix to be used.
        Throws:
        ApfloatRuntimeException
    • Method Detail

      • execute

        public Apfloat execute()
        Calculate pi using the Ramanujan binary splitting algorithm.
        Specified by:
        execute in interface Operation<Apfloat>
        Returns:
        Return value of the operation.