Пример #1
0
        public void mulTest()
        {
            CNumber_Integer target = new CNumber_Integer("0x7FFF.FFFF");
            CNumber_Integer two    = new CNumber_Integer("0x2");

            target = (CNumber_Integer)target.mul(two);
            Assert.AreEqual("0xFFFF.FFFE", target.AsString);

            target = (CNumber_Integer)target.mul(two);
            Assert.AreEqual("0x1.FFFF.FFFC", target.AsString);
        }
Пример #2
0
        public void Check_Multiplication_03()
        {
            CNumber_Integer a = new CNumber_Integer(378);
            CNumber_Integer b = (CNumber_Integer)a.mul(a);

            Assert.AreEqual(142884, b.AsInteger);
            Assert.AreEqual(3, b.size);
        }
Пример #3
0
        public void Check_Multiplication_02()
        {
            CNumber_Integer three = new CNumber_Integer(3);

            CNumber_Integer a = new CNumber_Integer(126);
            CNumber_Integer b = (CNumber_Integer)a.mul(three);

            Assert.AreEqual(378, b.AsInteger);
            Assert.AreEqual(2, b.size);
        }
Пример #4
0
        public void Check_Multiplication_01()
        {
            CNumber_Integer three = new CNumber_Integer(3);

            CNumber_Integer a = new CNumber_Integer(42);
            CNumber_Integer b = (CNumber_Integer)a.mul(three);

            // check if the operdands are unchanged
            Assert.AreEqual(42, a.AsInteger);
            Assert.AreEqual(3, three.AsInteger);

            // check the result
            Assert.AreEqual(126, b.AsInteger);
            Assert.AreEqual(1, b.size);
        }