Exemplo n.º 1
0
        public void BinaryNodTest2()
        {
            const int operandOne = 259;
            const int operandTwo = 513;
            const int expected   = 1;

            var actual = Euclid.BinaryNod(operandOne, operandTwo, out var ticks);

            Assert.AreEqual(expected, actual);
        }
Exemplo n.º 2
0
        public void BinaryNodTest1()
        {
            const int operandOne = 48;
            const int operandTwo = 64;
            const int expected   = 16;

            var actual = Euclid.BinaryNod(operandOne, operandTwo);

            Assert.AreEqual(expected, actual);
        }
Exemplo n.º 3
0
        static void Main(string[] args)
        {
            try
            {
                Console.Write($"Euclid Nod = {Euclid.Nod(48, 64, out var ticks)} ");
                Console.WriteLine($"Elapsed time: {ticks} ticks");

                Console.Write($"Binary Nod = {Euclid.BinaryNod(48, 64, out ticks)} ");
                Console.WriteLine($"Elapsed time: {ticks} ticks");

                Console.Write($"Nod of four numbers = {Euclid.Nod(78, 294, 570, 36, out ticks)} ");
                Console.WriteLine($"Elapsed time: {ticks} ticks");

                Console.Write($"Nod with array params = {Euclid.NodWithArrParams(out ticks,  78, 294, 570, 36)} ");
                Console.WriteLine($"Elapsed time: {ticks} ticks");
            }
            catch (Exception e)
            {
                ExceptionDisplay.Display(e);
            }

            Console.ReadKey();
        }