# Tag Archives: Guava-LongMath

## Java Guava | LongMath.checkedPow(long b, int k) method with Examples

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 »

## Java Guava | LongMath.divide(long, long, RoundingMode) method with Examples

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 »

## Java Guava | LongMath.checkedAdd(long a, long b) method with Examples

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 »

## Java Guava | LongMath.checkedMultiply(int a, int b) method with Examples

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 »

## Java Guava | LongMath log10(long x, RoundingMode mode) method with Examples

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 »

## Java Guava | mean(long x, long y) of LongMath Class with Examples

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 »

## Java Guava | mod(long x, long m) of LongMath Class with Examples

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 »

## Java Guava | gcd(long a, long b) of LongMath Class with Examples

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 »

## Java Guava | isPowerOfTwo(long x) of LongMath Class with Examples

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 »

## Java Guava | factorial(int n) method of IntMath Class with Examples

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 »

## Java Guava | sqrt(long x, RoundingMode mode) of LongMath Class with Examples

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 »

## Java Guava | pow(long b, int k) of LongMath Class with Examples

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 »

## Java Guava | log2(long x, RoundingMode mode) of LongMath Class with Examples

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 »

## Java Guava | binomial(int n, int k) of LongMath Class with Examples

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 »