Package 

Class Pow2


  • 
    public final class Pow2
    
                        
    • Method Summary

      Modifier and Type Method Description
      static int roundToPowerOfTwo(int value) Find the next larger positive power of two value up from the given value.
      static boolean isPowerOfTwo(int value) Is this value a power of two.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • roundToPowerOfTwo

         static int roundToPowerOfTwo(int value)

        Find the next larger positive power of two value up from the given value. If value is a power of two thenthis value will be returned.

        Parameters:
        value - from which next positive power of two will be found.
      • isPowerOfTwo

         static boolean isPowerOfTwo(int value)

        Is this value a power of two.

        Parameters:
        value - to be tested to see if it is a power of two.