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

◆ operator^()

static BigInteger System.Numerics.BigInteger.operator^ ( BigInteger left,
BigInteger right )
inlinestatic

Definition at line 1658 of file BigInteger.cs.

1659 {
1660 if (left._bits == null && right._bits == null)
1661 {
1662 return left._sign ^ right._sign;
1663 }
1664 Span<uint> scratch = stackalloc uint[32];
1665 ReadOnlySpan<uint> readOnlySpan = left.ToUInt32Span(scratch);
1666 scratch = stackalloc uint[32];
1667 ReadOnlySpan<uint> readOnlySpan2 = right.ToUInt32Span(scratch);
1668 uint[] array = new uint[Math.Max(readOnlySpan.Length, readOnlySpan2.Length)];
1669 uint num = ((left._sign < 0) ? uint.MaxValue : 0u);
1670 uint num2 = ((right._sign < 0) ? uint.MaxValue : 0u);
1671 for (int i = 0; i < array.Length; i++)
1672 {
1673 uint num3 = ((i < readOnlySpan.Length) ? readOnlySpan[i] : num);
1674 uint num4 = ((i < readOnlySpan2.Length) ? readOnlySpan2[i] : num2);
1675 array[i] = num3 ^ num4;
1676 }
1677 return new BigInteger(array);
1678 }

References System.Numerics.BigInteger.BigInteger(), System.Numerics.BigInteger._bits, System.Numerics.BigInteger._sign, System.array, System.ReadOnlySpan< T >.Length, System.Math.Max(), and System.Numerics.BigInteger.ToUInt32Span().