public override int CompareTo(Expr other) { var pCmp = base.CompareTo(other); if (other is RationalNumericalExpr e) { if (pCmp == 0) { pCmp = Numer.CompareTo(e.Numer); if (pCmp == 0) { pCmp = Denom.CompareTo(e.Denom); } } } return(pCmp); }
//реализация методов интерфейсов public int CompareTo(Rational CompareNumber) { return(Numer.CompareTo(CompareNumber)); }