isWithin method

bool isWithin(
  1. int val
)

Returns bool whether or not val is between low and high. The range includes the val, so

Range(low: 1, high: 3).isWithin(3);

would return true.

Implementation

bool isWithin(int val) {
  return low <= val && val <= high;
}