System.Numerics.BigIntegerBuilder.ShiftLeft C# (CSharp) Méthode

ShiftLeft() public méthode

public ShiftLeft ( int cuShift, int cbitShift ) : void
cuShift int
cbitShift int
Résultat void
        public void ShiftLeft(int cuShift, int cbitShift) {
            int index = this._iuLast + cuShift;
            uint num2 = 0;
            if (cbitShift > 0) {
                num2 = this.High >> (0x20 - cbitShift);
                if (num2 != 0) {
                    index++;
                }
            }
            if (index == 0) {
                this._uSmall = this._uSmall << cbitShift;
            }
            else {
                uint[] sourceArray = this._rgu;
                bool flag = cuShift > 0;
                if (!this._fWritable || (this._rgu.Length <= index)) {
                    this._rgu = new uint[index + 1];
                    this._fWritable = true;
                    flag = false;
                }
                if (this._iuLast == 0) {
                    if (num2 != 0) {
                        this._rgu[cuShift + 1] = num2;
                    }
                    this._rgu[cuShift] = this._uSmall << cbitShift;
                }
                else if (cbitShift == 0) {
                    Array.Copy(sourceArray, 0, this._rgu, cuShift, this._iuLast + 1);
                }
                else {
                    int num3 = this._iuLast;
                    int num4 = this._iuLast + cuShift;
                    if (num4 < index) {
                        this._rgu[index] = num2;
                    }
                    while (num3 > 0) {
                        this._rgu[num4] = (sourceArray[num3] << cbitShift) | (sourceArray[num3 - 1] >> (0x20 - cbitShift));
                        num3--;
                        num4--;
                    }
                    this._rgu[cuShift] = sourceArray[0] << cbitShift;
                }
                this._iuLast = index;
                if (flag) {
                    Array.Clear(this._rgu, 0, cuShift);
                }
            }
        }

Same methods

BigIntegerBuilder::ShiftLeft ( int cbit ) : void

Usage Example

Exemple #1
0
 public static void GCD(ref BigIntegerBuilder reg1, ref BigIntegerBuilder reg2)
 {
     if (((reg1._iuLast > 0) && (reg1._rgu[0] == 0)) || ((reg2._iuLast > 0) && (reg2._rgu[0] == 0)))
     {
         int num  = reg1.MakeOdd();
         int num2 = reg2.MakeOdd();
         LehmerGcd(ref reg1, ref reg2);
         int cbit = Math.Min(num, num2);
         if (cbit > 0)
         {
             reg1.ShiftLeft(cbit);
         }
     }
     else
     {
         LehmerGcd(ref reg1, ref reg2);
     }
 }
All Usage Examples Of System.Numerics.BigIntegerBuilder::ShiftLeft