Package org.apfloat.samples
Class Pi.GaussLegendrePiCalculator
java.lang.Object
org.apfloat.samples.Pi.GaussLegendrePiCalculator
- All Implemented Interfaces:
Serializable
,Operation<Apfloat>
- Enclosing class:
Pi
Calculates pi using the Gauss-Legendre algorithm.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate long
private int
private static final long
-
Constructor Summary
ConstructorsConstructorDescriptionGaussLegendrePiCalculator
(long precision, int radix) Construct a pi calculator with the specified precision and radix. -
Method Summary
Modifier and TypeMethodDescriptionexecute()
Calculate pi using the Gauss-Legendre iteration.private static long
gaussLegendrePrecision
(int k, int r, int radix)
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
precision
private long precision -
radix
private int radix
-
-
Constructor Details
-
GaussLegendrePiCalculator
public 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 Details