-
public class MathUtils
-
-
Method Summary
Modifier and Type Method Description final Integerlimit(Integer number, Integer between, Integer and)Limits the given number between the other values final Floatlimit(Float number, Float between, Float and)Limits the given number between the other values final Floatmax(Float number, Float max)final Integermax(Integer number, Integer max)final Floatmin(Float number, Float min)final Integermin(Integer number, Integer min)final Integerfloor(Float value)Returns the largest integer less than or equal to the specified float. final Integerceil(Float value)Returns the smallest integer greater than or equal to the specified float. -
-
Method Detail
-
limit
final Integer limit(Integer number, Integer between, Integer 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
final 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.
-
floor
final Integer 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).
-
-
-
-