Package com.comphenix.protocol.utility
Class IntegerMath
java.lang.Object
com.comphenix.protocol.utility.IntegerMath
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic intnextPowerOfTwo(int x) This calculates the smallest y for which 2^y > x
-
Field Details
-
MAX_SIGNED_POWER_OF_TWO
public static final int MAX_SIGNED_POWER_OF_TWO- See Also:
-
-
Method Details
-
nextPowerOfTwo
public static int nextPowerOfTwo(int x) This calculates the smallest y for which 2^y > x- Parameters:
x- the number that the next power of 2 should be calculated for.- Returns:
- If the next power of two would be larger than
MAX_SIGNED_POWER_OF_TWO, this method returnsInteger.MAX_VALUE - See Also:
-