Package org.lwjgl.system
Class MathUtil
- java.lang.Object
-
- org.lwjgl.system.MathUtil
-
public final class MathUtil extends java.lang.ObjectMath utility class.Method names in this class are prefixed with
mathto avoid ambiguities when used with static imports.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method and Description static booleanmathIsPoT(int value)Returns true if the specified integervalueis a power-of-two number.static intmathLog2i(int value)Find the integer logarithm base 2 of the given value.static intmathRoundPoT(int value)Rounds the specified integervalueup to the next power-of-two number.static longmathUIntToPtr(int value)Converts an unsigned integer value to a pointer value.
-
-
-
Method Detail
-
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
-
mathUIntToPtr
public static long mathUIntToPtr(int value)
Converts an unsigned integer value to a pointer value.- Parameters:
value- the unsigned integer- Returns:
- the pointer value
-
mathLog2i
public static int mathLog2i(int value)
Find the integer logarithm base 2 of the given value.- Parameters:
value- the value for which to find its logarithm
-
-