|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.metasyntactic.math.Functions
Simple alternative mathematical functions. Often int based as alternatives to the slower float based ones in java.lang.Math
Method Summary | |
static java.math.BigInteger[] |
extendedEuclideanAlgorithm(java.math.BigInteger a,
java.math.BigInteger b)
Input: positive integers a and b Output: integers x and y such that gcd(a, b) = xa + yb |
static int |
extendedEuclidian(int a,
int m)
|
static java.math.BigInteger |
greatestCommonDivisor(java.math.BigInteger a,
java.math.BigInteger b)
|
static java.math.BigInteger |
inverse(java.math.BigInteger a,
java.math.BigInteger m)
Given a and m, we know that gcd(a, m) = a*x + m*y. |
static int |
log2(long num)
|
static void |
main(java.lang.String[] args)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
public static int log2(long num)
public static int extendedEuclidian(int a, int m)
public static java.math.BigInteger greatestCommonDivisor(java.math.BigInteger a, java.math.BigInteger b)
public static java.math.BigInteger inverse(java.math.BigInteger a, java.math.BigInteger m)
public static java.math.BigInteger[] extendedEuclideanAlgorithm(java.math.BigInteger a, java.math.BigInteger b)
public static void main(java.lang.String[] args)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |