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

◆ operator long()

static System.Numerics.BigInteger.operator long ( BigInteger value)
inlineexplicitstatic

Definition at line 1503 of file BigInteger.cs.

1504 {
1505 if (value._bits == null)
1506 {
1507 return value._sign;
1508 }
1509 int num = value._bits.Length;
1510 if (num > 2)
1511 {
1512 throw new OverflowException(System.SR.Overflow_Int64);
1513 }
1514 ulong num2 = ((num <= 1) ? value._bits[0] : NumericsHelpers.MakeUlong(value._bits[1], value._bits[0]));
1515 long num3 = (long)((value._sign > 0) ? num2 : (0L - num2));
1516 if ((num3 > 0 && value._sign > 0) || (num3 < 0 && value._sign < 0))
1517 {
1518 return num3;
1519 }
1520 throw new OverflowException(System.SR.Overflow_Int64);
1521 }
static string Overflow_Int64
Definition SR.cs:1774
Definition SR.cs:7
readonly uint[] _bits
Definition BigInteger.cs:20

References System.L, System.Numerics.NumericsHelpers.MakeUlong(), System.SR.Overflow_Int64, and System.value.