I need help doing this problem without any conditionals or loops:
Write the function getInRange which takes 3 values (which you may assume are all numeric) -- x, bound1, and bound2, where bound1 is not necessarily less than bound2. If x is between the two bounds, just return it unmodified. Otherwise, if x is less than the lower bound, return the lower bound, or if x is greater than the upper bound, return the upper bound.