Example usage for Java com.google.common.math LongMath fields, constructors, methods, implement or subclass
The text is from its open source code.
long | binomial(int n, int k) Returns n choose k , also known as the binomial coefficient of n and k , or Long#MAX_VALUE if the result does not fit in a long . |
long | checkedAdd(long a, long b) Returns the sum of a and b , provided it does not overflow. |
long | checkedMultiply(long a, long b) Returns the product of a and b , provided it does not overflow. |
long | checkedPow(long b, int k) Returns the b to the k th power, provided it does not overflow. |
long | checkedSubtract(long a, long b) Returns the difference of a and b , provided it does not overflow. |
long | divide(long p, long q, RoundingMode mode) Returns the result of dividing p by q , rounding using the specified RoundingMode . |
boolean | isPowerOfTwo(long x) Returns true if x represents a power of two. |
int | log2(long x, RoundingMode mode) Returns the base-2 logarithm of x , rounded according to the specified rounding mode. |
long | mean(long x, long y) Returns the arithmetic mean of x and y , rounded toward negative infinity. |
int | mod(long x, int m) Returns x mod m , a non-negative value less than m . |
long | mod(long x, long m) Returns x mod m , a non-negative value less than m . |
long | pow(long b, int k) Returns b to the k th power. |