Equivalent of `max(bottomLimit, min(upperLimit, value))`
Equivalent of
max(bottomLimit, min(upperLimit, value))