public void Sub(ref int sign, ref BigIntegerBuilder reg) {
if (reg._iuLast == 0) {
this.Sub(ref sign, reg._uSmall);
}
else if (this._iuLast == 0) {
uint u = this._uSmall;
if (u == 0) {
this = new BigIntegerBuilder(ref reg);
}
else {
this.Load(ref reg);
this.Sub(ref sign, u);
}
sign = -sign;
}
else if (this._iuLast < reg._iuLast) {
this.SubRev(ref reg);
sign = -sign;
}
else {
int iuMin = reg._iuLast + 1;
if (this._iuLast == reg._iuLast) {
this._iuLast = BigInteger.GetDiffLength(this._rgu, reg._rgu, this._iuLast + 1) - 1;
if (this._iuLast < 0) {
this._iuLast = 0;
this._uSmall = 0;
return;
}
uint num3 = this._rgu[this._iuLast];
uint num4 = reg._rgu[this._iuLast];
if (this._iuLast == 0) {
if (num3 < num4) {
this._uSmall = num4 - num3;
sign = -sign;
return;
}
this._uSmall = num3 - num4;
return;
}
if (num3 < num4) {
reg._iuLast = this._iuLast;
this.SubRev(ref reg);
reg._iuLast = iuMin - 1;
sign = -sign;
return;
}
iuMin = this._iuLast + 1;
}
this.EnsureWritable();
uint uBorrow = 0;
for (int i = 0; i < iuMin; i++) {
uBorrow = SubBorrow(ref this._rgu[i], reg._rgu[i], uBorrow);
}
if (uBorrow != 0) {
this.ApplyBorrow(iuMin);
}
this.Trim();
}
}