Class Pi.GaussLegendrePiCalculator
java.lang.Object
org.apfloat.samples.Pi.GaussLegendrePiCalculator
- All Implemented Interfaces:
Serializable, Operation<Apfloat>
- Enclosing class:
Pi
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate longprivate intprivate 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 longgaussLegendrePrecision(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
-
execute
-
gaussLegendrePrecision
private static long gaussLegendrePrecision(int k, int r, int radix)
-