Exemple #1
0
        //_______________________________________________________________________________________________________
        public static phanso operator -(phanso t1, phanso t2)
        {
            phanso hieu = new phanso();

            hieu.ts = t1.ts * t2.ms - t2.ts * t1.ms;
            hieu.ms = t2.ms * t1.ms;
            hieu.ToiGian();
            return(hieu);
        }
Exemple #2
0
        //---------------------------------------------------------------
        public static phanso operator +(phanso t1, phanso t2)
        {
            phanso Tong = new phanso();

            Tong.ts = t1.ts * t2.ms + t2.ts * t1.ms;
            Tong.ms = t2.ms * t1.ms;
            Tong.ToiGian();
            return(Tong);
        }
Exemple #3
0
        //===============================================================================================
        public phanso Cong(phanso b)
        {
            phanso Tong = new phanso();

            Tong.ts = this.ts * b.ms + b.ts * this.ms;
            Tong.ms = this.ms + b.ms;
            Tong.ToiGian();
            return(Tong);
        }
Exemple #4
0
        // hiệu hai phân số -------------------------------------------------------------------
        public phanso Hieu(phanso b)
        {
            phanso hieu = new phanso();

            hieu.ts = this.ts * b.ms - b.ts * this.ms;
            hieu.ms = this.ms + b.ms;
            hieu.ToiGian();
            return(hieu);
        }