compareValue method

int compareValue(
  1. num value
)

Compares the given value against the extents.

Returns -1 if the value is less than the extents. Returns 0 if the value is within the extents inclusive. Returns 1 if the value is greater than the extents.

Implementation

int compareValue(num value) {
  if (value < min) {
    return -1;
  }
  if (value > max) {
    return 1;
  }
  return 0;
}