Package org.lwjgl.system
Class MathUtil
java.lang.Object
org.lwjgl.system.MathUtil
Math utility class.
Method names in this class are prefixed with math to avoid ambiguities when used with static imports.
-
Method Summary
Modifier and TypeMethodDescriptionstatic booleanmathHasZeroByte(int value) static booleanmathHasZeroByte(long value) static booleanmathHasZeroShort(int value) static booleanmathHasZeroShort(long value) static booleanmathIsPoT(int value) Returns true if the specified integervalueis a power-of-two number.static intmathRoundPoT(int value) Rounds the specified integervalueup to the next power-of-two number.
-
Method Details
-
mathIsPoT
public static boolean mathIsPoT(int value) Returns true if the specified integervalueis a power-of-two number.- Parameters:
value- the value to test- Returns:
- true if the value if a power-of-two number.
-
mathRoundPoT
public static int mathRoundPoT(int value) Rounds the specified integervalueup to the next power-of-two number. The returned value will be equal tovalueif it already is a power-of-two number.- Parameters:
value- the value to round-up. Must be a number between1and1 << 30.- Returns:
- the power-of-two rounded value
-
mathHasZeroByte
public static boolean mathHasZeroByte(int value) -
mathHasZeroByte
public static boolean mathHasZeroByte(long value) -
mathHasZeroShort
public static boolean mathHasZeroShort(int value) -
mathHasZeroShort
public static boolean mathHasZeroShort(long value)
-