compareTo method

int compareTo(
  1. LexoDecimal other
)

Implementation

int compareTo(LexoDecimal other) {
  if (identical(this, other)) {
    return 0;
  }
  // if (!other) {
  //   return 1;
  // }
  var tMag = mag;
  var oMag = other.mag;
  if (sig > other.sig) {
    oMag = oMag.shiftLeft(sig - other.sig);
  } else if (sig < other.sig) {
    tMag = tMag.shiftLeft(other.sig - sig);
  }
  return tMag.compareTo(oMag);
}