public final class Pow2
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static boolean |
isPowerOfTwo(int value)
Is this value a power of two.
|
static int |
roundToPowerOfTwo(int value)
Find the next larger positive power of two value up from the given value.
|
public static int roundToPowerOfTwo(int value)
value
- from which next positive power of two will be found.public static boolean isPowerOfTwo(int value)
value
- to be tested to see if it is a power of two.