Class NumericUtils


  • public final class NumericUtils
    extends Object
    • Method Detail

      • saturatedCast

        public static int saturatedCast​(long value)
        Returns the int nearest in value to value.
        Parameters:
        value - any long value
        Returns:
        the same value cast to int if it is in the range of the int type, Integer.MAX_VALUE if it is too large, or Integer.MIN_VALUE if it is too small