Example usage for Java org.apache.commons.math3.util ArithmeticUtils fields, constructors, methods, implement or subclass
The text is from its open source code.
long | binomialCoefficient(final int n, final int k) Returns an exact representation of the Binomial Coefficient, " n choose k ", the number of k -element subsets that can be selected from an n -element set. |
double | binomialCoefficientDouble(final int n, final int k) Returns a double representation of the Binomial Coefficient, " n choose k ", the number of k -element subsets that can be selected from an n -element set. |
double | binomialCoefficientLog(final int n, final int k) Returns the natural log of the Binomial Coefficient, " n choose k ", the number of k -element subsets that can be selected from an n -element set. |
long | factorial(final int n) Returns n!. |
double | factorialLog(final int n) Compute the natural logarithm of the factorial of n . |
int | gcd(int p, int q) Computes the greatest common divisor of the absolute value of two numbers, using a modified version of the "binary gcd" method. |
long | gcd(final long p, final long q) Gets the greatest common divisor of the absolute value of two numbers, using the "binary gcd" method which avoids division and modulo operations. |
boolean | isPowerOfTwo(long n) Returns true if the argument is a power of two. |
int | lcm(int a, int b) Returns the least common multiple of the absolute value of two numbers, using the formula lcm(a,b) = (a / gcd(a,b)) * b . |
long | lcm(long a, long b) Returns the least common multiple of the absolute value of two numbers, using the formula lcm(a,b) = (a / gcd(a,b)) * b . |
int | mulAndCheck(int x, int y) Multiply two integers, checking for overflow. |
long | mulAndCheck(long a, long b) Multiply two long integers, checking for overflow. |
int | pow(final int k, int e) Raise an int to an int power. |
int | pow(final int k, long e) Raise an int to a long power. |
long | pow(final long k, int e) Raise a long to an int power. |
long | pow(final long k, long e) Raise a long to a long power. |
BigInteger | pow(final BigInteger k, int e) Raise a BigInteger to an int power. |
BigInteger | pow(final BigInteger k, long e) Raise a BigInteger to a long power. |
BigInteger | pow(final BigInteger k, BigInteger e) Raise a BigInteger to a BigInteger power. |