-
public class MathUtilsMethods from libGDX - https://github.com/libgdx/libgdx
-
-
Method Summary
Modifier and Type Method Description static intlimit(int number, int between, int and)Limits the given number between the other values static floatlimit(float number, float between, float and)Limits the given number between the other values static floatmax(float number, float max)static floatmin(float number, float min)static intmax(int number, int max)static intmin(int number, int min)static intfloor(float value)Returns the largest integer less than or equal to the specified float. static intceil(float value)Returns the smallest integer greater than or equal to the specified float. -
-
Method Detail
-
limit
static int limit(int number, int between, int and)
Limits the given number between the other values
- Parameters:
number- The number to limit.between- The smallest value the number can take.and- The biggest value the number can take.
-
limit
static float limit(float number, float between, float and)
Limits the given number between the other values
- Parameters:
number- The number to limit.between- The smallest value the number can take.and- The biggest value the number can take.
-
max
static float max(float number, float max)
-
min
static float min(float number, float min)
-
max
static int max(int number, int max)
-
min
static int min(int number, int min)
-
floor
static int floor(float value)
Returns the largest integer less than or equal to the specified float. This method will only properly floor floats from-(2^14) to (Float.MAX_VALUE - 2^14).
-
ceil
static int ceil(float value)
Returns the smallest integer greater than or equal to the specified float. This method will only properly ceil floats from-(2^14) to (Float.MAX_VALUE - 2^14).
-
-
-
-