wrapInt static method
Wraps an integer val between min and max. If min = 1, max = 5
and val = 7, this will return 2.
Implementation
static int wrapInt(int val, int min, int max) {
return wrapDouble(val.toDouble(), min.toDouble(), max.toDouble()).toInt();
}