Class Logs

java.lang.Object
com.ibm.wala.util.math.Logs

public class Logs extends Object
simple utilities with logarithms
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static int
    binaryLogUp(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 int
    binaryLogUp(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 boolean
    isPowerOf2(int x)
     
    static int
    log2(int x)
     

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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

      public static int log2(int x) throws IllegalArgumentException
      Parameters:
      x - where x == 2^n for some integer n
      Throws:
      IllegalArgumentException
    • binaryLogUp

      @Deprecated(since="1.10.0", forRemoval=true) public static int binaryLogUp(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. It may be removed in a future release.
      Binary log: finds the smallest power k such that 2^k >= n
    • binaryLogUp

      @Deprecated(since="1.10.0", forRemoval=true) public static int binaryLogUp(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. It may be removed in a future release.
      Binary log: finds the smallest power k such that 2^k >= n