Package org.apfloat.samples
Class Pi.RamanujanPiCalculator
java.lang.Object
org.apfloat.samples.Pi.RamanujanPiCalculator
- All Implemented Interfaces:
Serializable
,Operation<Apfloat>
- Direct Known Subclasses:
PiParallel.ParallelRamanujanPiCalculator
- Enclosing class:
Pi
Basic class for calculating pi using the Ramanujan binary splitting algorithm.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Pi.BinarySplittingPiCalculator
private long
private int
private static final long
-
Constructor Summary
ConstructorsModifierConstructorDescriptionRamanujanPiCalculator
(long precision, int radix) Construct a pi calculator with the specified precision and radix.protected
RamanujanPiCalculator
(Pi.BinarySplittingPiCalculator calculator, long precision, int radix) Construct a pi calculator with the specified binary splitting algorithm. -
Method Summary
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
calculator
-
precision
private long precision -
radix
private int radix
-
-
Constructor Details
-
RamanujanPiCalculator
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 Details