operator / method

Quantity operator /(
  1. dynamic divisor
)

Returns the quotient of this quantity and divisor, including both value and dimensions.

  • This Quantity object is unaffected.
  • If the uncertainty of the resulting product Quantity is calculated it will be equal to the relative combined standard uncertainty, which is defined as the square root of the sum of the squares of the two quantities' relative standard uncertainties.

Implementation

Quantity operator /(dynamic divisor) {
  if (divisor is num || divisor is Number) return this / Scalar(value: divisor);

  if (divisor is Quantity) {
    return this * divisor.inverse();
  } else {
    throw const QuantityException('Expected a Quantity, num or Number object');
  }
}