clamp method

Decimal clamp(
  1. Decimal lowerLimit,
  2. Decimal upperLimit
)

Clamps this to be in the range lowerLimit-upperLimit.

Implementation

Decimal clamp(Decimal lowerLimit, Decimal upperLimit) =>
    _rational.clamp(lowerLimit._rational, upperLimit._rational).toDecimal();