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

◆ BigInteger() [11/12]

System.Numerics.BigInteger.BigInteger ( ReadOnlySpan< uint > value,
uint[] valueArray,
bool negative )
inlineprivate

Definition at line 465 of file BigInteger.cs.

466 {
467 if (!value.IsEmpty && value[^1] == 0)
468 {
469 int num = value.Length - 1;
470 while (num > 0 && value[num - 1] == 0)
471 {
472 num--;
473 }
474 value = value.Slice(0, num);
475 valueArray = null;
476 }
477 if (value.IsEmpty)
478 {
479 this = s_bnZeroInt;
480 }
481 else if (value.Length == 1 && value[0] < 2147483648u)
482 {
483 _sign = (int)(negative ? (0 - value[0]) : value[0]);
484 _bits = null;
485 if (_sign == int.MinValue)
486 {
487 this = s_bnMinInt;
488 }
489 }
490 else
491 {
492 _sign = ((!negative) ? 1 : (-1));
493 _bits = valueArray ?? value.ToArray();
494 }
495 }
readonly uint[] _bits
Definition BigInteger.cs:20
static readonly BigInteger s_bnZeroInt
Definition BigInteger.cs:26
static readonly BigInteger s_bnMinInt
Definition BigInteger.cs:22

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