Пример #1
0
        public void Arithmetic_Test2()
        {
            var natural1      = new Natural(10);
            var natural2      = new Natural(6);
            var natural3      = new Natural(3);
            var natural4      = new Natural(10);
            var natural22     = new Natural(6);
            int expected      = 2;
            int expected2     = 12;
            var natural_array = natural1.DivideAndRemainder(natural2);

            natural_array[0].Add(natural3);
            natural_array[0].Add(natural2.Divide(natural3));
            var actual = natural_array[1].Gcd(natural_array[0]);

            Console.WriteLine("First Result: " + actual.GetBigValue());
            Assert.AreEqual(expected, actual.GetIntValue());
            Assert.AreEqual(2, natural_array[1].GetIntValue());
            var actual2 = actual.ModPow(natural_array[0], natural3.Add(natural4));

            Assert.AreEqual(expected2, actual2.GetIntValue());
            Console.WriteLine("Second Result: " + actual2.GetBigValue());
        }