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

Mul() public méthode

public Mul ( uint u ) : void
u uint
Résultat void
        public void Mul(uint u) {
            if (u == 0) {
                this.Set((uint)0);
            }
            else if (u != 1) {
                if (this._iuLast == 0) {
                    this.Set((ulong)this._uSmall * (ulong)u);
                }
                else {
                    this.EnsureWritable(1);
                    uint uCarry = 0;
                    for (int i = 0; i <= this._iuLast; i++) {
                        uCarry = MulCarry(ref this._rgu[i], u, uCarry);
                    }
                    if (uCarry != 0) {
                        this.SetSizeKeep(this._iuLast + 2, 0);
                        this._rgu[this._iuLast] = uCarry;
                    }
                }
            }
        }

Same methods

BigIntegerBuilder::Mul ( BigIntegerBuilder &regMul ) : void
BigIntegerBuilder::Mul ( BigIntegerBuilder &reg1, BigIntegerBuilder &reg2 ) : void

Usage Example

        /// <summary>Multiplies two specified <see cref="BigInteger" /> values.</summary>
        /// <returns>The product of <paramref name="left" /> and <paramref name="right" />.</returns>
        /// <param name="left">The first value to multiply.</param>
        /// <param name="right">The second value to multiply.</param>
        public static BigInteger operator *(BigInteger left, BigInteger right)
        {
            var sign     = 1;
            var regLeft  = new BigIntegerBuilder(left, ref sign);
            var regRight = new BigIntegerBuilder(right, ref sign);

            regLeft.Mul(ref regRight);
            return(regLeft.GetInteger(sign));
        }
All Usage Examples Of System.Numerics.BigIntegerBuilder::Mul