Keeps value within provided bounds.

@param value Value to be restricted
@param minValue Min value
@param maxValue Max value
@return Restricted value
488228
public static float restrict(float value, float minValue, float maxValue) {
        return Math.max(minValue, Math.min(value, maxValue));
    }
649590
public void setMax (float max) {
		if (min > max) throw new IllegalArgumentException("min can't be > max");

		this.max = max;

		if (current > max) {
			current = max;
			spinner.notifyValueChanged(spinner.isProgrammaticChangeEvents());
		}
	}
303487
public static Number checkBetween(Number value, Number min, Number max) {
		notNull(value);
		notNull(min);
		notNull(max);
		double valueDouble = value.doubleValue();
		double minDouble = min.doubleValue();
		double maxDouble = max.doubleValue();
		if (valueDouble < minDouble || valueDouble > maxDouble) {
			throw new IllegalArgumentException(StrUtil.format("Length must be between {} and {}.", min, max));
		}
		return value;
	}
909177
public static function isOptionalNumericRange($value, $min, $max)
    {
        /* No additional validations when the value is null. */
        if (null === $value) {

            return true;
        }

        return self::isRequiredNumericRange($value, $min, $max);
    }
218681
public void setValueRange(int min, int max, boolean animation){
        if(max < min || (min == mMinValue && max == mMaxValue))
            return;

        float oldValue = getExactValue();
        float oldPosition = getPosition();
        mMinValue = min;
        mMaxValue = max;

        setValue(oldValue, animation);
        if(mOnPositionChangeListener != null && oldPosition == getPosition() && oldValue != getExactValue())
            mOnPositionChangeListener.onPositionChanged(this, false, oldPosition, oldPosition, Math.round(oldValue), getValue());
    }
474502
private float limit(float value, float min, float max) {
    return Math.min(Math.max(min, value), max);
  }
146049
public static void lessThan(long value, long maxValue, String name) {
        if (value <= 0) {
            throw new IllegalArgumentException(name + " should be > 0, current value " + value);
        }
        if (value > maxValue) {
            throw new IllegalArgumentException(name + " should be <= " + maxValue + ", current value " + value);
        }
    }
908840
public static Validation<Integer> range(int min, int max) {
        return greaterThan(min).and(lowerThan(max));
    }
218562
public static function rangeNumber($value, $minNumber, $maxNumber): bool
    {
        if (!is_numeric($value)) {
            return false;
        }

        if ($value < $minNumber) {
            return false;
        }
        if ($value > $maxNumber) {
            return false;
        }

        return true;
    }
1327935
public void setRange( int minValue , int maxValue ) {
		this.maxValue = maxValue;
		this.minValue = minValue;

		histogram.resize(maxValue-minValue+1);
		histIndexes.resize(maxValue-minValue+1);
	}
1110664
public static function isRequiredNumberRange($value, $min, $max)
    {
        return (is_int($value) || is_float($value)) && $min <= $value && $max >= $value;
    }
679728
public synchronized ProgressBar setValue(int value) {
        if(value < min) {
            value = min;
        }
        if(value > max) {
            value = max;
        }
        if(this.value != value) {
            this.value = value;
            invalidate();
        }
        return this;
    }
480193
public LongParameter setMinimumValue(long minimumValue) {
		if (hasMaximumValue) {
			Util.checkParameter(minimumValue <= maximumValue,
				"Minimum value (" + minimumValue + ") must be less than or equal to maximum (" + maximumValue + ")");
		}

		this.hasMinimumValue = true;
		this.minimumValue = minimumValue;

		return this;
	}
368196
public static function isOptionalFloatRange($value, $min, $max)
    {
        /* No additional validations when the value is null. */
        if (null === $value) {

            return true;
        }

        return self::isRequiredFloatRange($value, $min, $max);
    }
40227
function (value, min, max) {
            var interval;
            if (min > max) {
                max = min + max;
                min = max - min;
                max = max - min;
            }
            interval = max - min;
            return min + ((value % interval) + interval) % interval;
        }
478840
public static Integer validateInteger(final String context,
			final String input, final int minValue, final int maxValue,
			final boolean allowNull) throws ValidationException {
		return validator.getValidInteger(context, input, minValue, maxValue,
				allowNull);
	}
320826
public static boolean isBetween(Number value, Number min, Number max) {
		Assert.notNull(value);
		Assert.notNull(min);
		Assert.notNull(max);
		final double doubleValue = value.doubleValue();
		return (doubleValue >= min.doubleValue()) && (doubleValue <= max.doubleValue());
	}