multiply method

FixedPoint multiply(
  1. dynamic other
)

Multiply

Implementation

FixedPoint multiply(dynamic other) {
  final comparable = _verifyCompatible(other);
  // ROHD's native `Multiply` gate truncates its output to the input width
  // and always treats operands as unsigned, so it cannot produce a correct
  // full-precision signed product. `NativeMultiplier` sign/zero-extends
  // the operands and produces a full double-width product instead.
  final product = NativeMultiplier(this, comparable,
          signedMultiplicand: signed, signedMultiplier: signed)
      .product;
  return FixedPoint.of(product,
      signed: signed,
      integerWidth: 2 * integerWidth + (signed ? 1 : 0),
      fractionWidth: 2 * fractionWidth);
}