Class MathUtil


  • public final class MathUtil
    extends Object
    • Method Detail

      • clamp

        public static int clamp​(int value,
                                int low,
                                int high)
        Returns value clamped between low and high boundaries.
        Parameters:
        value - Value to clamp.
        low - The lower boundary to which to clamp value.
        high - The higher boundary to which to clamp value.
      • clamp

        public static double clamp​(double value,
                                   double low,
                                   double high)
        Returns value clamped between low and high boundaries.
        Parameters:
        value - Value to clamp.
        low - The lower boundary to which to clamp value.
        high - The higher boundary to which to clamp value.