Corrects the parameter so that it belongs to the interval. If parameter is already within interval, then it is returned as is. Otherwise parameter is moved to closest of endpoints.