multiply method

LexoInteger multiply(
  1. LexoInteger other
)

Implementation

LexoInteger multiply(LexoInteger other) {
  checkSystem(other);
  if (isZero()) {
    return this;
  }
  if (other.isZero()) {
    return other;
  }
  if (isOneish()) {
    return identical(sign, other.sign)
        ? LexoInteger.make(sys, 1, other.mag)
        : LexoInteger.make(sys, -1, other.mag);
  }
  if (other.isOneish()) {
    return identical(sign, other.sign)
        ? LexoInteger.make(sys, 1, mag)
        : LexoInteger.make(sys, -1, mag);
  }
  final newMag = LexoInteger.Multiply(sys, mag, other.mag);
  return identical(sign, other.sign)
      ? LexoInteger.make(sys, 1, newMag)
      : LexoInteger.make(sys, -1, newMag);
}