// // 1/2 + 1/4 = 6/8 public PhanSo Cong(PhanSo p) { PhanSo kq = new PhanSo(); kq._TuSo = _TuSo * p._MauSo + _MauSo * p._TuSo; kq._MauSo = _MauSo * p._MauSo; kq.ToiGian(); return(kq); }
public static bool operator !=(PhanSo ps1, PhanSo ps2) { bool kq = false; PhanSo p1 = ps1.Clone(); PhanSo p2 = ps2.Clone(); p1.ToiGian(); p2.ToiGian(); if (p1._TuSo != p2._TuSo || p1._MauSo != p2._MauSo) { kq = true; } return(kq); }
public static bool operator ==(PhanSo ps1, PhanSo ps2) { bool kq = false; PhanSo p1 = ps1.MemberwiseClone() as PhanSo; PhanSo p2 = ps2.MemberwiseClone() as PhanSo; p1.ToiGian(); p2.ToiGian(); if (p1._TuSo == p2._TuSo && p1._MauSo == p2._MauSo) { kq = true; } return(kq); }