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

◆ GreatestCommonDivisor() [2/2]

static BigInteger System.Numerics.BigInteger.GreatestCommonDivisor ( uint[] leftBits,
uint[] rightBits )
inlinestaticprivate

Definition at line 778 of file BigInteger.cs.

779 {
780 if (rightBits.Length == 1)
781 {
782 uint right = BigIntegerCalculator.Remainder(leftBits, rightBits[0]);
783 return BigIntegerCalculator.Gcd(rightBits[0], right);
784 }
785 if (rightBits.Length == 2)
786 {
787 uint[] array = BigIntegerCalculator.Remainder(leftBits, rightBits);
788 ulong left = ((ulong)rightBits[1] << 32) | rightBits[0];
789 ulong right2 = ((ulong)array[1] << 32) | array[0];
790 return BigIntegerCalculator.Gcd(left, right2);
791 }
792 uint[] array2 = BigIntegerCalculator.Gcd(leftBits, rightBits);
793 return new BigInteger(array2, array2, negative: false);
794 }

References System.Numerics.BigInteger.BigInteger(), System.array, System.Numerics.BigIntegerCalculator.Gcd(), and System.Numerics.BigIntegerCalculator.Remainder().