Package org.apfloat
Class GCDHelper
java.lang.Object
org.apfloat.GCDHelper
Binary recursive GCD algorithm implementation.
- Since:
- 1.6
- Version:
- 1.10.0
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static class
private static class
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static Apint[]
binaryDivide
(Apint a, Apint b) private static Apint
private static Apint
elementaryGcd
(Apint a, Apint b) static Apint
private static GCDHelper.HalfGcdType
halfBinaryGcd
(Apint a, Apint b, long k) private static Apint
powerOfTwo
(long n) private static Apint
recursiveGcd
(Apint a, Apint b) private static long
-
Constructor Details
-
GCDHelper
private GCDHelper()
-
-
Method Details
-
gcd
- Throws:
ApfloatRuntimeException
-
elementaryGcd
- Throws:
ApfloatRuntimeException
-
recursiveGcd
- Throws:
ApfloatRuntimeException
-
halfBinaryGcd
private static GCDHelper.HalfGcdType halfBinaryGcd(Apint a, Apint b, long k) throws ApfloatRuntimeException - Throws:
ApfloatRuntimeException
-
binaryDivide
- Throws:
ApfloatRuntimeException
-
v
- Throws:
ApfloatRuntimeException
-
powerOfTwo
- Throws:
ApfloatRuntimeException
-
cmod
- Throws:
ApfloatRuntimeException
-