clamp method Null safety
Returns this num clamped to be in the range
The comparison is done using compareTo and therefore takes
account. This also implies that double.nan is treated as the maximal
upperLimit must form a valid range where
lowerLimit.compareTo(upperLimit) <= 0.
num clamp(num lowerLimit, num upperLimit);