clamp a number to inclusive min and max intervals.
you can also provide a type alias for the output interval OutInterval number through the use of the generic parameter.