Restrict value from max.
max
double limitHigh(double max) { if (this > max) { return max; } return this; }