returns this if it is between min and max (inclusive) otherwise returns min or max whichever is closer
min
max
double limitTo(double min, double max) => (this as num)._limitTo(min, max).toDouble();