Beispiel #1
0
        public void SelfMul(CountSystem inCS)
        {
            CountSystem TestCS = new CountSystem(myOrder);


            CountSystem retCS = new CountSystem(myOrder);

            CountSystem inSecond = inCS;

            if (myOrder != inCS.myOrder)
            {
                inSecond = GetNewOrder(myOrder, inCS);
            }

            for (int i = 0; i < inSecond.MyValue.Count; ++i)
            {
                TestCS.SetValue(this);

                for (int ii = 0; ii < TestCS.MyValue.Count; ++ii)
                {
                    TestCS.MyValue[ii] *= inSecond.MyValue[i];
                }

                TestCS.Normalize();

                TestCS.SelfTenPow(i);

                retCS.SelfSum(TestCS);
            }

            MyValue = retCS.MyValue;
        }
Beispiel #2
0
        public static CountSystem operator *(CountSystem inCSfirst, CountSystem inCSsecond)
        {
            CountSystem TestCS = new CountSystem(inCSfirst.myOrder);


            CountSystem retCS = new CountSystem(inCSfirst.myOrder);

            CountSystem inSecond = inCSsecond;

            if (inCSfirst.myOrder != inCSsecond.myOrder)
            {
                inSecond = GetNewOrder(inCSfirst.myOrder, inCSsecond);
            }

            for (int i = 0; i < inSecond.MyValue.Count; ++i)
            {
                TestCS.SetValue(inCSfirst);

                for (int ii = 0; ii < TestCS.MyValue.Count; ++ii)
                {
                    TestCS.MyValue[ii] *= inSecond.MyValue[i];
                }

                TestCS.Normalize();

                TestCS.SelfTenPow(i);

                retCS.SelfSum(TestCS);
            }

            return(retCS);
        }