Clamps an integer between two integers.
input when min <= input <= max, and either min or max otherwise.