内核级的BigInteger

不知道微软为什么把这个给设置成内internal了。如果设置成public该多好啊。

 

internal struct BigInteger : IFormattable, IEquatable<BigInteger>, IComparable<BigInteger>, IComparable

 

Name: System.Numeric.BigInteger 

Assembly: System.Core, Version=3.5.0.0 

这是所有的成员:

 

[Serializable, StructLayout(LayoutKind.Sequential), Immutable, ComVisible(false)]
internal struct BigInteger : IFormattable, IEquatable<BigInteger>, IComparable<BigInteger>, IComparable
{
    private const int DecimalScaleFactorMask = 0xff0000;
    private const int DecimalSignMask = -2147483648;
    private const int BitsPerDigit = 0x20;
    private const ulong Base = 0x100000000L;
    private const int UpperBoundForSchoolBookMultiplicationDigits = 0x40;
    private const int ForceSchoolBookMultiplicationThresholdDigits = 8;
    private static readonly uint[] maxCharsPerDigit;
    private static readonly uint[] groupRadixValues;
    private static readonly uint[] zeroArray;
    private readonly short _sign;
    private readonly uint[] _data;
    private int _length;
    public static BigInteger Zero { get; }
    public static BigInteger One { get; }
    public static BigInteger MinusOne { get; }
    public BigInteger(int value);
    public BigInteger(long value);
    [CLSCompliant(false)]
    public BigInteger(uint value);
    [CLSCompliant(false)]
    public BigInteger(ulong value);
    public BigInteger(float value);
    public BigInteger(double value);
    public BigInteger(decimal value);
    public BigInteger(byte[] value);
    public BigInteger(byte[] value, bool negative);
    private BigInteger(int _sign, params uint[] _data);
    public static BigInteger Abs(BigInteger x);
    public static BigInteger GreatestCommonDivisor(BigInteger x, BigInteger y);
    public static BigInteger Remainder(BigInteger dividend, BigInteger divisor);
    public static BigInteger Negate(BigInteger x);
    public static BigInteger Pow(BigInteger baseValue, BigInteger exponent);
    public static BigInteger ModPow(BigInteger baseValue, BigInteger exponent, BigInteger modulus);
    private BigInteger Square();
    public byte[] ToByteArray();
    public byte[] ToByteArray(out bool isNegative);
    public int Sign { [Pure] get; }
    public static BigInteger operator +(BigInteger value);
    public static BigInteger operator -(BigInteger value);
    public static BigInteger operator ++(BigInteger value);
    public static BigInteger operator --(BigInteger value);
    public static BigInteger operator %(BigInteger x, BigInteger y);
    public static explicit operator byte(BigInteger value);
    [CLSCompliant(false)]
    public static explicit operator sbyte(BigInteger value);
    public static explicit operator short(BigInteger value);
    [CLSCompliant(false)]
    public static explicit operator ushort(BigInteger value);
    public static explicit operator int(BigInteger value);
    [CLSCompliant(false)]
    public static explicit operator uint(BigInteger value);
    public static explicit operator long(BigInteger value);
    [CLSCompliant(false)]
    public static explicit operator ulong(BigInteger value);
    public static explicit operator float(BigInteger value);
    public static explicit operator double(BigInteger value);
    public static explicit operator decimal(BigInteger value);
    public static explicit operator BigInteger(float value);
    public static explicit operator BigInteger(double value);
    public static explicit operator BigInteger(decimal value);
    public static implicit operator BigInteger(byte value);
    [CLSCompliant(false)]
    public static implicit operator BigInteger(sbyte value);
    public static implicit operator BigInteger(short value);
    [CLSCompliant(false)]
    public static implicit operator BigInteger(ushort value);
    [Pure]
    public static implicit operator BigInteger(int value);
    [CLSCompliant(false)]
    public static implicit operator BigInteger(uint value);
    public static implicit operator BigInteger(long value);
    [CLSCompliant(false)]
    public static implicit operator BigInteger(ulong value);
    private static bool IsNegative(byte[] doubleBits);
    private static ushort Exponent(byte[] doubleBits);
    private static ulong Mantissa(byte[] doubleBits);
    private int Length { get; }
    private static int GetLength(uint[] _data);
    private static uint[] copy(uint[] v);
    private static uint[] resize(uint[] v, int len);
    private static uint[] add0(uint[] x, int xl, uint[] y, int yl);
    private static uint[] InternalAdd(uint[] x, int xl, uint[] y, int yl);
    private static uint[] sub(uint[] x, int xl, uint[] y, int yl);
    [Pure]
    public static int Compare(BigInteger x, BigInteger y);
    [Pure]
    public static bool operator ==(BigInteger x, BigInteger y);
    [Pure]
    public static bool operator !=(BigInteger x, BigInteger y);
    [Pure]
    public static bool operator <(BigInteger x, BigInteger y);
    [Pure]
    public static bool operator <=(BigInteger x, BigInteger y);
    [Pure]
    public static bool operator >(BigInteger x, BigInteger y);
    [Pure]
    public static bool operator >=(BigInteger x, BigInteger y);
    public static BigInteger Add(BigInteger x, BigInteger y);
    public static BigInteger operator +(BigInteger x, BigInteger y);
    public static BigInteger Subtract(BigInteger x, BigInteger y);
    public static BigInteger operator -(BigInteger x, BigInteger y);
    public static BigInteger Multiply(BigInteger x, BigInteger y);
    [Pure]
    public static BigInteger operator *(BigInteger x, BigInteger y);
    private static BigInteger MultiplySchoolBook(BigInteger x, BigInteger y);
    private static BigInteger MultiplyKaratsuba(BigInteger x, BigInteger y);
    private BigInteger RestrictTo(int numDigits);
    public static BigInteger Divide(BigInteger dividend, BigInteger divisor);
    public static BigInteger operator /(BigInteger dividend, BigInteger divisor);
    private static int GetNormalizeShift(uint value);
    [Conditional("DEBUG")]
    private static void TestNormalize(uint[] u, uint[] un, int shift);
    [Conditional("DEBUG")]
    private static void TestDivisionStep(uint[] un, uint[] vn, uint[] q, uint[] u, uint[] v);
    [Conditional("DEBUG")]
    private static void TestResult(uint[] u, uint[] v, uint[] q, uint[] r);
    private static void Normalize(uint[] u, int l, uint[] un, int shift);
    private static void Unnormalize(uint[] un, out uint[] r, int shift);
    private static void DivModUnsigned(uint[] u, uint[] v, out uint[] q, out uint[] r);
    public static BigInteger DivRem(BigInteger dividend, BigInteger divisor, out BigInteger remainder);
    private static BigInteger LeftShift(BigInteger x, int shift);
    private static BigInteger RightShift(BigInteger x, int shift);
    public static BigInteger Parse(string s);
    public static BigInteger Parse(string s, IFormatProvider provider);
    public static BigInteger Parse(string s, NumberStyles style);
    public static BigInteger Parse(string s, NumberStyles style, IFormatProvider provider);
    public static bool TryParse(string s, out BigInteger b);
    public static bool TryParse(string s, NumberStyles style, IFormatProvider formatProvider, out BigInteger value);
    private static bool TryParse(string s, NumberStyles style, IFormatProvider formatProvider, out BigInteger value, out string error);
    private static uint ParseSingleDigit(char c, ulong radix, out string error);
    private static bool IsWhiteSpace(char ch);
    public string ToString(string format);
    public string ToString(IFormatProvider formatProvider);
    public string ToString(string format, IFormatProvider formatProvider);
    public override string ToString();
    private string ToString(uint radix, bool useCapitalHexDigits, NumberFormatInfo info);
    private static void AppendRadix(uint rem, uint radix, bool useCapitalHexDigits, char[] tmp, StringBuilder buf, bool leadingZeros);
    private static uint div(uint[] n, ref int nl, uint d);
    public override int GetHashCode();
    public bool Equals(BigInteger other);
    public override bool Equals(object obj);
    public int CompareTo(BigInteger other);
    public int CompareTo(object obj);
    static BigInteger();
}
Expand Methods

这是完整代码(不要幻想编译此代码)

 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值