Class NumberUtils

java.lang.Object
me.hugmanrique.cartage.util.NumberUtils

public final class NumberUtils extends Object
Provides methods that operate on numeric values.
See Also:
Bit Twiddling Hacks by S. E. Anderson
  • Method Details

    • isPowerOf2

      public static boolean isPowerOf2(int value)
      Returns whether the given value is a power of 2.
      Parameters:
      value - the value to check
      Returns:
      true if the value is a power of 2; false otherwise