Package 

Class MathUtils


  • 
    public class MathUtils
    
                        

    Methods from libGDX - https://github.com/libgdx/libgdx

    • Method Summary

      Modifier and Type Method Description
      static int limit(int number, int between, int and) Limits the given number between the other values
      static float limit(float number, float between, float and) Limits the given number between the other values
      static float max(float number, float max)
      static float min(float number, float min)
      static int max(int number, int max)
      static int min(int number, int min)
      static int floor(float value) Returns the largest integer less than or equal to the specified float.
      static int ceil(float value) Returns the smallest integer greater than or equal to the specified float.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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).