Microsoft.Scripting.Math.BigInteger.GetBits C# (CSharp) Method

GetBits() private method

private GetBits ( ) : uint[]
return uint[]
    public uint[] GetBits() {
      if (sign == 0) return new uint[0];
      int mostSignificantNonZeroWord;
      for (
          mostSignificantNonZeroWord = data.Length - 1;
          mostSignificantNonZeroWord >= 0 && data[mostSignificantNonZeroWord] == 0;
          mostSignificantNonZeroWord--
      ) ;
      uint[] bits = new uint[mostSignificantNonZeroWord + 1];
      Array.Copy(data, bits, mostSignificantNonZeroWord + 1);
      return bits;
    }

Usage Example

コード例 #1
0
ファイル: ConstantExpression.cs プロジェクト: bclubb/ironruby
        private static Expression BigIntegerConstant(BigInteger value) {
            int ival;
            if (value.AsInt32(out ival)) {
                return Expression.Call(
                    typeof(BigInteger).GetMethod("Create", new Type[] { typeof(int) }),
                    Expression.Constant(ival)
                );
            }

            long lval;
            if (value.AsInt64(out lval)) {
                return Expression.Call(
                    typeof(BigInteger).GetMethod("Create", new Type[] { typeof(long) }),
                    Expression.Constant(lval)
                );
            }

            return Expression.New(
                typeof(BigInteger).GetConstructor(new Type[] { typeof(int), typeof(uint[]) }),
                Expression.Constant((int)value.Sign),
                CreateUIntArray(value.GetBits())
            );
        }
All Usage Examples Of Microsoft.Scripting.Math.BigInteger::GetBits