public void Add(ref BigIntegerBuilder reg) {
if (reg._iuLast == 0) {
this.Add(reg._uSmall);
}
else if (this._iuLast == 0) {
uint u = this._uSmall;
if (u == 0) {
this = new BigIntegerBuilder(ref reg);
}
else {
this.Load(ref reg, 1);
this.Add(u);
}
}
else {
this.EnsureWritable(Math.Max(this._iuLast, reg._iuLast) + 1, 1);
int iu = reg._iuLast + 1;
if (this._iuLast < reg._iuLast) {
iu = this._iuLast + 1;
Array.Copy(reg._rgu, (int)(this._iuLast + 1), this._rgu, (int)(this._iuLast + 1), (int)(reg._iuLast - this._iuLast));
this._iuLast = reg._iuLast;
}
uint uCarry = 0;
for (int i = 0; i < iu; i++) {
uCarry = AddCarry(ref this._rgu[i], reg._rgu[i], uCarry);
}
if (uCarry != 0) {
this.ApplyCarry(iu);
}
}
}