Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ BigInteger() [3/12]

System.Numerics.BigInteger.BigInteger ( long value)
inline

Definition at line 125 of file BigInteger.cs.

126 {
127 if (int.MinValue < value && value <= int.MaxValue)
128 {
129 _sign = (int)value;
130 _bits = null;
131 return;
132 }
133 if (value == int.MinValue)
134 {
135 this = s_bnMinInt;
136 return;
137 }
138 ulong num = 0uL;
139 if (value < 0)
140 {
141 num = (ulong)(-value);
142 _sign = -1;
143 }
144 else
145 {
146 num = (ulong)value;
147 _sign = 1;
148 }
149 if (num <= uint.MaxValue)
150 {
151 _bits = new uint[1];
152 _bits[0] = (uint)num;
153 }
154 else
155 {
156 _bits = new uint[2];
157 _bits[0] = (uint)num;
158 _bits[1] = (uint)(num >> 32);
159 }
160 }
readonly uint[] _bits
Definition BigInteger.cs:20
static readonly BigInteger s_bnMinInt
Definition BigInteger.cs:22

References System.Numerics.BigInteger._bits, System.Numerics.BigInteger._sign, System.Numerics.BigInteger.s_bnMinInt, and System.value.