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