Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
System.Numerics.BigInteger Struct Reference

Public Member Functions

 BigInteger (int value)
 
 BigInteger (uint value)
 
 BigInteger (long value)
 
 BigInteger (ulong value)
 
 BigInteger (float value)
 
 BigInteger (double value)
 
 BigInteger (decimal value)
 
 BigInteger (byte[] value)
 
 BigInteger (ReadOnlySpan< byte > value, bool isUnsigned=false, bool isBigEndian=false)
 
override int GetHashCode ()
 
override bool Equals ([NotNullWhen(true)] object? obj)
 
bool Equals (long other)
 
bool Equals (ulong other)
 
bool Equals (BigInteger other)
 
int CompareTo (long other)
 
int CompareTo (ulong other)
 
int CompareTo (BigInteger other)
 
int CompareTo (object? obj)
 
byte[] ToByteArray ()
 
byte[] ToByteArray (bool isUnsigned=false, bool isBigEndian=false)
 
bool TryWriteBytes (Span< byte > destination, out int bytesWritten, bool isUnsigned=false, bool isBigEndian=false)
 
int GetByteCount (bool isUnsigned=false)
 
override string ToString ()
 
string ToString (IFormatProvider? provider)
 
string ToString (string? format)
 
string ToString (string? format, IFormatProvider? provider)
 
bool TryFormat (Span< char > destination, out int charsWritten, ReadOnlySpan< char > format=default(ReadOnlySpan< char >), IFormatProvider? provider=null)
 
long GetBitLength ()
 
int CompareTo (T? other)
 
int CompareTo (T? other)
 
bool Equals (T? other)
 

Static Public Member Functions

static BigInteger Parse (string value)
 
static BigInteger Parse (string value, NumberStyles style)
 
static BigInteger Parse (string value, IFormatProvider? provider)
 
static BigInteger Parse (string value, NumberStyles style, IFormatProvider? provider)
 
static bool TryParse ([NotNullWhen(true)] string? value, out BigInteger result)
 
static bool TryParse ([NotNullWhen(true)] string? value, NumberStyles style, IFormatProvider? provider, out BigInteger result)
 
static BigInteger Parse (ReadOnlySpan< char > value, NumberStyles style=NumberStyles.Integer, IFormatProvider? provider=null)
 
static bool TryParse (ReadOnlySpan< char > value, out BigInteger result)
 
static bool TryParse (ReadOnlySpan< char > value, NumberStyles style, IFormatProvider? provider, out BigInteger result)
 
static int Compare (BigInteger left, BigInteger right)
 
static BigInteger Abs (BigInteger value)
 
static BigInteger Add (BigInteger left, BigInteger right)
 
static BigInteger Subtract (BigInteger left, BigInteger right)
 
static BigInteger Multiply (BigInteger left, BigInteger right)
 
static BigInteger Divide (BigInteger dividend, BigInteger divisor)
 
static BigInteger Remainder (BigInteger dividend, BigInteger divisor)
 
static BigInteger DivRem (BigInteger dividend, BigInteger divisor, out BigInteger remainder)
 
static BigInteger Negate (BigInteger value)
 
static double Log (BigInteger value)
 
static double Log (BigInteger value, double baseValue)
 
static double Log10 (BigInteger value)
 
static BigInteger GreatestCommonDivisor (BigInteger left, BigInteger right)
 
static BigInteger Max (BigInteger left, BigInteger right)
 
static BigInteger Min (BigInteger left, BigInteger right)
 
static BigInteger ModPow (BigInteger value, BigInteger exponent, BigInteger modulus)
 
static BigInteger Pow (BigInteger value, int exponent)
 
static BigInteger operator- (BigInteger left, BigInteger right)
 
static implicit operator BigInteger (byte value)
 
static implicit operator BigInteger (sbyte value)
 
static implicit operator BigInteger (short value)
 
static implicit operator BigInteger (ushort value)
 
static implicit operator BigInteger (int value)
 
static implicit operator BigInteger (uint value)
 
static implicit operator BigInteger (long value)
 
static implicit operator BigInteger (ulong value)
 
static operator BigInteger (float value)
 
static operator BigInteger (double value)
 
static operator BigInteger (decimal value)
 
static operator byte (BigInteger value)
 
static operator sbyte (BigInteger value)
 
static operator short (BigInteger value)
 
static operator ushort (BigInteger value)
 
static operator int (BigInteger value)
 
static operator uint (BigInteger value)
 
static operator long (BigInteger value)
 
static operator ulong (BigInteger value)
 
static operator float (BigInteger value)
 
static operator double (BigInteger value)
 
static operator decimal (BigInteger value)
 
static BigInteger operator& (BigInteger left, BigInteger right)
 
static BigInteger operator| (BigInteger left, BigInteger right)
 
static BigInteger operator^ (BigInteger left, BigInteger right)
 
static BigInteger operator<< (BigInteger value, int shift)
 
static BigInteger operator>> (BigInteger value, int shift)
 
static BigInteger operator~ (BigInteger value)
 
static BigInteger operator- (BigInteger value)
 
static BigInteger operator+ (BigInteger value)
 
static BigInteger operator++ (BigInteger value)
 
static BigInteger operator-- (BigInteger value)
 
static BigInteger operator+ (BigInteger left, BigInteger right)
 
static BigInteger operator* (BigInteger left, BigInteger right)
 
static BigInteger operator/ (BigInteger dividend, BigInteger divisor)
 
static BigInteger operator% (BigInteger dividend, BigInteger divisor)
 
static bool operator< (BigInteger left, BigInteger right)
 
static bool operator<= (BigInteger left, BigInteger right)
 
static bool operator> (BigInteger left, BigInteger right)
 
static bool operator>= (BigInteger left, BigInteger right)
 
static bool operator== (BigInteger left, BigInteger right)
 
static bool operator!= (BigInteger left, BigInteger right)
 
static bool operator< (BigInteger left, long right)
 
static bool operator<= (BigInteger left, long right)
 
static bool operator> (BigInteger left, long right)
 
static bool operator>= (BigInteger left, long right)
 
static bool operator== (BigInteger left, long right)
 
static bool operator!= (BigInteger left, long right)
 
static bool operator< (long left, BigInteger right)
 
static bool operator<= (long left, BigInteger right)
 
static bool operator> (long left, BigInteger right)
 
static bool operator>= (long left, BigInteger right)
 
static bool operator== (long left, BigInteger right)
 
static bool operator!= (long left, BigInteger right)
 
static bool operator< (BigInteger left, ulong right)
 
static bool operator<= (BigInteger left, ulong right)
 
static bool operator> (BigInteger left, ulong right)
 
static bool operator>= (BigInteger left, ulong right)
 
static bool operator== (BigInteger left, ulong right)
 
static bool operator!= (BigInteger left, ulong right)
 
static bool operator< (ulong left, BigInteger right)
 
static bool operator<= (ulong left, BigInteger right)
 
static bool operator> (ulong left, BigInteger right)
 
static bool operator>= (ulong left, BigInteger right)
 
static bool operator== (ulong left, BigInteger right)
 
static bool operator!= (ulong left, BigInteger right)
 

Package Functions

 BigInteger (int n, uint[] rgu)
 
bool TryWriteOrCountBytes (Span< byte > destination, out int bytesWritten, bool isUnsigned=false, bool isBigEndian=false)
 

Static Package Functions

static int GetDiffLength (uint[] rgu1, uint[] rgu2, int cu)
 

Package Attributes

readonly int _sign
 
readonly uint[] _bits
 

Properties

static BigInteger Zero [get]
 
static BigInteger One [get]
 
static BigInteger MinusOne [get]
 
bool IsPowerOfTwo [get]
 
bool IsZero [get]
 
bool IsOne [get]
 
bool IsEven [get]
 
int Sign [get]
 

Private Types

enum  GetBytesMode { AllocateArray , Count , Span }
 

Private Member Functions

 BigInteger (ReadOnlySpan< uint > value, uint[] valueArray, bool negative)
 
 BigInteger (uint[] value)
 
byte[] TryGetBytes (GetBytesMode mode, Span< byte > destination, bool isUnsigned, bool isBigEndian, ref int bytesWritten)
 
ReadOnlySpan< uint > ToUInt32Span (Span< uint > scratch)
 

Static Private Member Functions

static BigInteger GreatestCommonDivisor (uint[] leftBits, uint[] rightBits)
 
static BigInteger Add (uint[] leftBits, int leftSign, uint[] rightBits, int rightSign)
 
static BigInteger Subtract (uint[] leftBits, int leftSign, uint[] rightBits, int rightSign)
 
static bool GetPartsForBitManipulation (ref BigInteger x, ref Span< uint > xd)
 

Static Private Attributes

static readonly BigInteger s_bnMinInt = new BigInteger(-1, new uint[1] { 2147483648u })
 
static readonly BigInteger s_bnOneInt = new BigInteger(1)
 
static readonly BigInteger s_bnZeroInt = new BigInteger(0)
 
static readonly BigInteger s_bnMinusOneInt = new BigInteger(-1)
 
static readonly byte[] s_success = Array.Empty<byte>()
 

Detailed Description

Definition at line 9 of file BigInteger.cs.


The documentation for this struct was generated from the following file: