Class Logs
java.lang.Object
com.ibm.wala.util.math.Logs
simple utilities with logarithms
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic intbinaryLogUp(int n) Deprecated, for removal: This API element is subject to removal in a future version.This method is used only by WALA's own unit tests.static intbinaryLogUp(long n) Deprecated, for removal: This API element is subject to removal in a future version.This method is used only by WALA's own unit tests.static booleanisPowerOf2(int x) static intlog2(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
Deprecated, for removal: This API element is subject to removal in a future version.This method is used only by WALA's own unit tests. It may be removed in a future release.Binary log: finds the smallest power k such that 2^k >= n -
binaryLogUp
Deprecated, for removal: This API element is subject to removal in a future version.This method is used only by WALA's own unit tests. It may be removed in a future release.Binary log: finds the smallest power k such that 2^k >= n
-