Example #1
0
        public DaThuc Tru(DaThuc B)
        {
            DaThuc lon = null;
            DaThuc be  = null;

            kiemTraCapDo(this, B, ref lon, ref be);
            DaThuc C;

            if (lon == this)
            {
                C = this.Copy();
                C = C.Cong(B.Copy().DoiDau());
            }
            else
            {
                C = B.Copy().DoiDau();
                C = C.Cong(this);
            }
            return(C);
        }
Example #2
0
        static DaThuc PhepTinhVoiSo(DaThuc A, phepTinhVoiSo phepTinh)
        {
            var B = A.Copy();

            for (int i = 0; i < A.N + 1; i++)
            {
                double temp = B[i];
                phepTinh(ref temp);
                B[i] = temp;
            }
            return(B);
        }
Example #3
0
        public DaThuc Cong(DaThuc B)
        {
            DaThuc lon = null;
            DaThuc be  = null;

            kiemTraCapDo(this, B, ref lon, ref be);
            DaThuc C = lon.Copy();

            for (int i = 0; i < be.N + 1; i++)
            {
                C[i] += be[i];
            }
            return(C);
        }
Example #4
0
 static DaThuc PhepTinhVoiSo(DaThuc A, phepTinhVoiSo phepTinh)
 {
     var B = A.Copy();
     for (int i = 0; i < A.N + 1; i++)
     {
         double temp = B[i];
         phepTinh(ref temp);
         B[i] = temp;
     }
     return B;
 }
Example #5
0
 public DaThuc Tru(DaThuc B)
 {
     DaThuc lon = null;
     DaThuc be = null;
     kiemTraCapDo(this, B, ref lon, ref be);
     DaThuc C;
     if (lon == this)
     {
         C = this.Copy();
         C = C.Cong(B.Copy().DoiDau());
     }
     else
     {
         C = B.Copy().DoiDau();
         C = C.Cong(this);
     }
     return C;
 }