public static int clamp(int value, int min, int max) {
		if (value < min) {
			return min;
		}
		if (value > max) {
			return max;
		}
		return value;
	}
Ensures that the given value is within the given range.

@param value the value to check
@param min the minimum value allowed
@param max the maximum value allowed
@return the clamped value
Ghidra/Framework/Generic/src/main/java/ghidra/util/MathUtilities.java