public void ExtendedEuclidTest_VNotPositive()
        {
            var u = new BigInteger(1);
            var v = new BigInteger(0);

            BigIntegerExtension.ExtendedEuclid(u, v);
        }
        public void ExtendedEuclidTest_TwoPrimes()
        {
            var u = new BigInteger(7823);
            var v = new BigInteger(7919);

            var result = BigIntegerExtension.ExtendedEuclid(u, v);

            Assert.AreEqual(3877, result.Item1);
            Assert.AreEqual(-3830, result.Item2);
            Assert.AreEqual(1, result.Item3);
        }
        public void ExtendedEuclidTest_TwoTwo()
        {
            var u = new BigInteger(2);
            var v = new BigInteger(2);

            var result = BigIntegerExtension.ExtendedEuclid(u, v);

            Assert.AreEqual(0, result.Item1);
            Assert.AreEqual(1, result.Item2);
            Assert.AreEqual(2, result.Item3);
        }
        public void ExtendedEuclidTest_DontComputeU2()
        {
            // Let 7703, 7607 and 7541 be three prime numbers.
            var u = new BigInteger(58088323); // 7703 * 7541
            var v = new BigInteger(57364387); // 7607 * 7541

            var result = BigIntegerExtension.ExtendedEuclid(u, v, false);

            Assert.AreEqual(1981, result.Item1);
            Assert.AreEqual(0, result.Item2);
            Assert.AreEqual(7541, result.Item3);
        }
        public void ExtendedEuclidTest_TwoProductsOfPrimes()
        {
            // Let 7703, 7607 and 7541 be three prime numbers.
            var u = new BigInteger(58088323); // 7703 * 7541
            var v = new BigInteger(57364387); // 7607 * 7541

            var result = BigIntegerExtension.ExtendedEuclid(u, v);

            Assert.AreEqual(1981, result.Item1);
            Assert.AreEqual(-2006, result.Item2);
            Assert.AreEqual(7541, result.Item3);
        }