returns this if it is not greater than max, otherwise max
max
int withUpperLimit(int max) => (this as num)._withUpperLimit(max).toInt();