return((r1.m !=r2.m)|| (r1.n !=r2.n)); } public static bool operator <(Rational r1, Rational r2) { return(r1.m * r2.n < r2.m* r1.n); } public static bool operator >(Rational r1, Rational r2) { return(r1.m * r2.n > r2.m* r1.n); } public static bool operator <(Rational r1, double r2) { return((double)r1.m / (double)r1.n < r2); } public static bool operator >(Rational r1, double r2) { return((double)r1.m / (double)r1.n > r2); } Наш последний пример демонстрирует работу с константами, булевыми и арифметическими выражениями над рациональными числами: public void TestRationalConst() |