Clamp a value between two other values.