Checks whether numeric input is between a minimum and a maximum value

@param   string|float|int
@param   float|int
@param   float|int
@return  bool
18093
public function _validation_numeric_between($val, $min_val, $max_val)
	{
		return $this->_empty($val) or (floatval($val) >= floatval($min_val) and floatval($val) <= floatval($max_val));
	}
1112950
public static boolean isBetween(double value, double min, double max)
    {
        return Double.compare(value, min) >= 0 && Double.compare(value, max) <= 0;
    }
318450
def _range_check(self, value, min_value, max_value):
        '''
        
        '''
        if value < min_value or value > max_value:
            raise ValueError('%s out of range - %s is not between %s and %s' % (self.__class__.__name__, value, min_value, max_value))
41810
public function rule_between( $key, $value, $min, $max )
	{
		return $this->rule_between_num( $key, strlen( $value ), $min, $max );
	}
508669
private function between($value, $min = null, $max = null) {

        $value = intval($value);

        if ($min !== null && $max !== null) {
            return $value >= intval($min) && $value <= intval($max);
        }

        if ($min !== null) {
            return intval($min) <= $value;
        }

        if ($max !== null) {
            return $value <= intval($max);
        }
        return false;
    }
1353878
@ArgumentsChecked
	@Throws(IllegalNullArgumentException.class)
	public static float checkFloat(@Nonnull final Number number) {
		Check.notNull(number, "number");
		if (!isInFloatRange(number)) {
			throw new IllegalNumberRangeException(number.toString(), FLOAT_MIN, FLOAT_MAX);
		}

		return number.floatValue();
	}
1214030
private static function validateRange($value, $min, $max)
	    {
	        $res = filter_var($value, FILTER_VALIDATE_INT, array(
	            'options' => array('min_range' => $min, 'max_range' => $max)
	        ));
	        if (false === $res) {
	            throw new OutOfRangeException("the submitted value is not contained within the valid range");
	        }

	        return $res;
	    }
318919
protected function validate_negative_float( $var, $include_zero = false, $min = null, $max = null ) {
		$validate = $this->validate_float( $var, $min, $max );
		if ( true === $validate ) {
			return $this->validate_negative( $var, $include_zero );
		}

		return $validate;
	}
1110664
public static function isRequiredNumberRange($value, $min, $max)
    {
        return (is_int($value) || is_float($value)) && $min <= $value && $max >= $value;
    }
302830
public static function isRequiredNumericRange($value, $min, $max)
    {
        return is_numeric($value) && $min <= $value && $max >= $value;
    }
43088
public function isValidStringLength($str, $min = null, $max = null): bool
    {
        $len = mb_strlen($str, 'UTF-8');

        return (($min !== null) && ($len >= $min)) || (($max !== null) && ($len <= $max));
    }
1169381
def between(min_value, max_value):
    ''
    message = N_('value should be between %(min)d and %(max)d') % \
                    dict(min=min_value, max=max_value)

    @validator(message)
    def wrapper(conv, value):
        if value is None:
            # it meens that this value is not required
            return True
        if value < min_value:
            return False
        if value > max_value:
            return False
        return True
    return wrapper
1178597
function clamp$1(v, min, max) {
    if (min === void 0) { min = 0; }
    if (max === void 0) { max = 100; }
    return Math.max(min, Math.min(max, v));
}
807163
private int minLimit(int input, int min) {
        if (input < min) {
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                Tr.debug(tc, "Config: " + input + " too small.");
            }
            return min;
        }
        return input;
    }
1342742
public static function isBetween($value, $min, $max, $inclusive = false)
    {
        \settype($value, 'int');
        \settype($min, 'int');
        \settype($max, 'int');

        if ($min > $max) {
            throw new \InvalidArgumentException(\sprintf('%s cannot be less than %s for validation', $min, $max));
        }

        if (false === $inclusive) {
            return (($value > $min) && ($value < $max));
        }

        return (($value >= $min) && ($value <= $max));
    }
528229
public static function isLte($value, $min)
    {
        is_array($min) && $min = $min[0];
        if (!is_numeric($value)) {
            return false;
        } else {
            return $value <= $min;
        }
    }
1353109
@ArgumentsChecked
	@Throws(IllegalNullArgumentException.class)
	public static boolean isInRange(@Nonnull final Number number, @Nonnull final BigInteger min, @Nonnull final BigInteger max) {
		Check.notNull(number, "number");
		Check.notNull(min, "min");
		Check.notNull(max, "max");

		BigInteger bigInteger = null;
		if (number instanceof Byte || number instanceof Short || number instanceof Integer || number instanceof Long) {
			bigInteger = BigInteger.valueOf(number.longValue());
		} else if (number instanceof Float || number instanceof Double) {
			bigInteger = new BigDecimal(number.doubleValue()).toBigInteger();
		} else if (number instanceof BigInteger) {
			bigInteger = (BigInteger) number;
		} else if (number instanceof BigDecimal) {
			bigInteger = ((BigDecimal) number).toBigInteger();
		} else {
			throw new IllegalNumberArgumentException("Return value is no known subclass of 'java.lang.Number': "
					+ number.getClass().getName());
		}
		return max.compareTo(bigInteger) >= 0 && min.compareTo(bigInteger) <= 0;
	}