Load() public method

public Load ( BigIntegerBuilder &reg ) : void
reg BigIntegerBuilder
return void
Ejemplo n.º 1
0
        public void Mul(ref BigIntegerBuilder regMul) {
            if (regMul._iuLast == 0) {
                this.Mul(regMul._uSmall);
            }
            else if (this._iuLast == 0) {
                uint u = this._uSmall;
                switch (u) {
                    case 1:
                        this = new BigIntegerBuilder(ref regMul);
                        return;

                    case 0:
                        return;
                }
                this.Load(ref regMul, 1);
                this.Mul(u);
            }
            else {
                int num2 = this._iuLast + 1;
                this.SetSizeKeep(num2 + regMul._iuLast, 1);
                int index = num2;
                while (--index >= 0) {
                    uint num4 = this._rgu[index];
                    this._rgu[index] = 0;
                    uint uCarry = 0;
                    for (int i = 0; i <= regMul._iuLast; i++) {
                        uCarry = AddMulCarry(ref this._rgu[index + i], regMul._rgu[i], num4, uCarry);
                    }
                    if (uCarry != 0) {
                        for (int j = (index + regMul._iuLast) + 1; (uCarry != 0) && (j <= this._iuLast); j++) {
                            uCarry = AddCarry(ref this._rgu[j], 0, uCarry);
                        }
                        if (uCarry != 0) {
                            this.SetSizeKeep(this._iuLast + 2, 0);
                            this._rgu[this._iuLast] = uCarry;
                        }
                    }
                }
            }
        }