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