Class Log2

java.lang.Object
dev.pfaff.unfettered.Log2

public final class Log2 extends Object
  • Constructor Details

    • Log2

      public Log2()
  • Method Details

    • log2nlz

      public static int log2nlz(int n)
      Exact integer log2. See https://stackoverflow.com/a/3305710.

      Implementations notes:

      Returns 0 for input 0.
    • log2nlz

      public static int log2nlz(long n)
      Exact long log2. See log2nlz(int) for details.

      Implementations notes:

      Returns 0 for input 0.
    • log2nlzUnchecked

      public static int log2nlzUnchecked(int n)
    • log2nlzUnchecked

      public static int log2nlzUnchecked(long n)