org.apfloat.samples
Class Pi.GaussLegendrePiCalculator

java.lang.Object
  extended byorg.apfloat.samples.Pi.GaussLegendrePiCalculator
All Implemented Interfaces:
Operation, java.io.Serializable
Enclosing class:
Pi

public static class Pi.GaussLegendrePiCalculator
extends java.lang.Object
implements Operation

Calculates pi using the Gauss-Legendre algorithm.

See Also:
Serialized Form

Constructor Summary
Pi.GaussLegendrePiCalculator(long precision, int radix)
          Construct a pi calculator with the specified precision and radix.
 
Method Summary
 java.lang.Object execute()
          Calculate pi using the Gauss-Legendre iteration.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Pi.GaussLegendrePiCalculator

public Pi.GaussLegendrePiCalculator(long precision,
                                    int radix)
Construct a pi calculator with the specified precision and radix.

Parameters:
precision - The target precision.
radix - The radix to be used.
Method Detail

execute

public java.lang.Object execute()
Calculate pi using the Gauss-Legendre iteration.

Specified by:
execute in interface Operation
Returns:
Return value of the operation.