clamp method

  1. @override
Int64 clamp(
  1. Object lowerLimit,
  2. Object upperLimit
)

Clamps this integer to be in the range lowerLimit - upperLimit.

Implementation

@override
Int64 clamp(Object lowerLimit, Object upperLimit) {
  Int64 lower = _promote(lowerLimit);
  Int64 upper = _promote(upperLimit);
  if (this < lower) return lower;
  if (this > upper) return upper;
  return this;
}