clamp<T extends num> static method

T clamp<T extends num>(
  1. T value,
  2. T minimumValue,
  3. T maximumValue
)

Implementation

static T clamp<T extends num>(T value, T minimumValue, T maximumValue)
{
  return Math.max(minimumValue, Math.min(maximumValue, value) );
}