game-engine/src/main/java/com/jzy/game/engine/math/MathUtil.java
/**
	 * Returns the next power of two. Returns the specified value if the value is
	 * already a power of two.
	 *
	 * @return
	 */
Returns the next power of two. Returns the specified value if the value is
already a power of two.

@return
Returns the next power of two . Returns the specified value if the value is already a power of two . @return
static public int nextPowerOfTwo(int value) {
		if (value == 0) {
			return 1;
		}
		value--;
		value |= value >> 1;
		value |= value >> 2;
		value |= value >> 4;
		value |= value >> 8;
		value |= value >> 16;
		return value + 1;
	}
static public int nextPowerOfTwo ( int value ) { if ( value == 0 ) { return 1 ; } value -- ; value |= value >> 1 ; value |= value >> 2 ; value |= value >> 4 ; value |= value >> 8 ; value |= value >> 16 ; return value + 1 ; }
Returns the next power of two.
Returns the next power of two .