make static method

LexoInteger make(
  1. LexoNumeralSystem sys,
  2. int sign,
  3. List<int> mag
)

Implementation

static LexoInteger make(LexoNumeralSystem sys, int sign, List<int> mag) {
  int actualLength;
  for (actualLength = mag.length;
      actualLength > 0 && identical(mag[actualLength - 1], 0);
      --actualLength) {}
  if (identical(actualLength, 0)) {
    return LexoInteger.zero(sys);
  }
  if (identical(actualLength, mag.length)) {
    return LexoInteger(sys, sign, mag);
  }
  final nmag = List<int>.filled(actualLength, 0);
  lexoHelper.arrayCopy(mag, 0, nmag, 0, actualLength);
  return LexoInteger(sys, sign, nmag);
}