add method

LexoDecimal add(
  1. LexoDecimal other
)

Implementation

LexoDecimal add(LexoDecimal other) {
  var tmag = mag;
  var tsig = sig;
  var omag = other.mag;
  num osig;
  for (osig = other.sig; tsig < osig; ++tsig) {
    tmag = tmag.shiftLeft();
  }
  while (tsig > osig) {
    omag = omag.shiftLeft();
    ++osig;
  }
  return LexoDecimal.make(tmag.add(omag), tsig);
}