Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/.net/23.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# BigInteger如何在内部存储值?_C#_.net_Biginteger - Fatal编程技术网

C# BigInteger如何在内部存储值?

C# BigInteger如何在内部存储值?,c#,.net,biginteger,C#,.net,Biginteger,BigInteger类有一个返回字节数组的方法。这是否表明该类在内部使用字节数组来存储数字 为了选择正确的数据类型来处理二进制数据,必须了解这一点。例如,如果该类使用Int64数组,那么通过任何调用函数操作原始数据时,使用类似的数组会更有效 例如,我调用ToByteArray方法来遍历字节以查找特定的二进制模式。根据它,它似乎将其信息存储为数据的uint[]和符号的int namespace System.Numerics { /// <summary>Represents

BigInteger类有一个返回字节数组的方法。这是否表明该类在内部使用字节数组来存储数字

为了选择正确的数据类型来处理二进制数据,必须了解这一点。例如,如果该类使用Int64数组,那么通过任何调用函数操作原始数据时,使用类似的数组会更有效

例如,我调用ToByteArray方法来遍历字节以查找特定的二进制模式。

根据它,它似乎将其信息存储为数据的uint[]和符号的int

namespace System.Numerics
{
    /// <summary>Represents an arbitrarily large signed integer.</summary>
    [Serializable]
    public struct BigInteger : IFormattable, IComparable, IComparable<BigInteger>, IEquatable<BigInteger>
    {

    // For values int.MinValue < n <= int.MaxValue, the value is stored in sign
    // and _bits is null. For all other values, sign is +1 or -1 and the bits are in _bits
    internal int _sign;
    internal uint[] _bits;
根据数据,它似乎将其信息存储为数据的uint[]和符号的int

namespace System.Numerics
{
    /// <summary>Represents an arbitrarily large signed integer.</summary>
    [Serializable]
    public struct BigInteger : IFormattable, IComparable, IComparable<BigInteger>, IEquatable<BigInteger>
    {

    // For values int.MinValue < n <= int.MaxValue, the value is stored in sign
    // and _bits is null. For all other values, sign is +1 or -1 and the bits are in _bits
    internal int _sign;
    internal uint[] _bits;

用像ILSpy或Reflector这样的拆卸器打开它,自己看看。用像ILSpy或Reflector这样的拆卸器打开它,自己看看。