Skip to content

Tag Archives: Guava-LongMath

checkedPow(long b, long k) is a method of Guava’s LongMath Class which accepts two parameters b and k and is used to find the k-th… Read More
The divide(long p, long q, RoundingMode mode) method of Guava’s LongMath Class accepts three parameters and calculates the result of dividing first parameter by second… Read More
The checkedAdd(long a, long b) is a method of Guava’s LongMath Class which accepts two parameters a and b, and returns their sum. Syntax: public… Read More
The checkedMultiply(long a, long b) is a method of Guava’s LongMath Class which accepts two parameters a and b, and returns their product. Syntax: public… Read More
The method log10(long x, RoundingMode mode) of Guava’s LongMath Class accepts two parameters and calculates the base-10 logarithmic value of the first parameter rounded according… Read More
The mean(long x, long y) method of Guava’s LongMath Class accepts two parameters x and y and calculates arithmetic mean of them rounded towards negative… Read More
The mod(long x, long m) method of Guava’s LongMath Class accepts two parameters x and m, and used to calculate the value of x modulus… Read More
The method gcd(long a, long b) of Guava’s LongMath Class returns the greatest common divisor of two parameters a and b. Syntax: public static long… Read More
The method isPowerOfTwo(long x) of Guava’s LongMath Class is used to check if a number is power of two or not. It accepts the number… Read More
The factorial(int n) method of Guava’s IntMath Class returns the product of the first n positive integers, which is n!. Syntax: public static int factorial(int… Read More
The method sqrt(long x, RoundingMode mode) of Guava’s LongMath Class accepts two parameters and calculates the square root of the first parameter rounded according to… Read More
The method pow(long b, int k) of Guava’s LongMath Class returns b to the kth power. Even if the result overflows, it will be equal… Read More
The method log2(long x, RoundingMode mode) of Guava’s LongMath Class accepts two parameters and calculates the base-2 logarithmic value of the first parameter rounded according… Read More
The binomial(int n, int k) method of Guava’s LongMath Class accepts two parameters n and k and calculate the value of the binomial coefficient .… Read More