Class Logs
java.lang.Object
com.ibm.wala.util.math.Logs
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic int
binaryLogUp
(int n) Binary log: finds the smallest power k such that 2^k >= nstatic int
binaryLogUp
(long n) Binary log: finds the smallest power k such that 2^k >= nstatic boolean
isPowerOf2
(int x) static int
log2
(int x)
-
Constructor Details
-
Logs
public Logs()
-
-
Method Details
-
isPowerOf2
public static boolean isPowerOf2(int x) - Returns:
- true iff x == 2^n for some integer n
-
log2
- Parameters:
x
- where x == 2^n for some integer n- Throws:
IllegalArgumentException
-
binaryLogUp
public static int binaryLogUp(int n) Binary log: finds the smallest power k such that 2^k >= n -
binaryLogUp
public static int binaryLogUp(long n) Binary log: finds the smallest power k such that 2^k >= n
-