Exemple #1
0
        public void TestZeroAndNumber()
        {
            var algo = new KaratsubaMultiplication();

            BigInteger input1 = 0;
            BigInteger input2 = 2236548992111222222;
            BigInteger result = algo.Compute(Input.From <BigInteger, BigInteger>(input1, input2));

            Assert.AreEqual(result, BigInteger.Zero);
        }
Exemple #2
0
        public void TestSmallAndBigNumbers()
        {
            var algo = new KaratsubaMultiplication();

            BigInteger input1 = 5678;
            BigInteger input2 = 2236548992111222222;
            BigInteger result = algo.Compute(Input.From <BigInteger, BigInteger>(input1, input2));

            Assert.AreEqual(result, input1 * input2);
        }