Class MathUtils
- java.lang.Object
-
- com.github.barteksc.pdfviewer.util.MathUtils
-
public class MathUtils extends java.lang.Object
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static intceil(float value)Returns the smallest integer greater than or equal to the specified float.static intfloor(float value)Returns the largest integer less than or equal to the specified float.static floatlimit(float number, float between, float and)Limits the given number between the other valuesstatic intlimit(int number, int between, int and)Limits the given number between the other valuesstatic floatmax(float number, float max)static intmax(int number, int max)static floatmin(float number, float min)static intmin(int number, int min)
-
-
-
Method Detail
-
limit
public 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.- Returns:
- The limited number.
-
limit
public 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.- Returns:
- The limited number.
-
max
public static float max(float number, float max)
-
min
public static float min(float number, float min)
-
max
public static int max(int number, int max)
-
min
public static int min(int number, int min)
-
floor
public 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
public 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).
-
-