operator * method

Unit operator *(
  1. Unit other
)

Multiplies this unit by other, creating a new DerivedUnit.

If either unit is the dimensionless unit "one", the other unit is returned.

Unit multiplication (as occurs when two physical quantities are multiplied) is accomplished by multiplying their dimensions and scales.

See also Dimensions.operator*.

Implementation

Unit operator *(Unit other) {
  if (identical(this, one)) return other;
  if (identical(other, one)) return this;
  return DerivedUnit(
    dimensions: dimensions * other.dimensions,
    scale: scale * other.scale,
    symbol: '$safeSymbol·${other.safeSymbol}',
    singular: '$safeSingular-${other.safeSingular}',
    plural: '$safeSingular-${other.safePlural}',
  );
}