operator - method

Power operator -(
  1. Power other
)

Subtracts another power from this power.

The other power is converted to the unit of this power before subtraction. The result is a new Power instance with the difference, expressed in the unit of this power (the left-hand operand).

Implementation

Power operator -(Power other) {
  final otherValueInThisUnit = other.getValue(unit);
  return Power(value - otherValueInThisUnit, unit);
}