I get the logic behind all of these. But I dont understand "bool Rational::isEqualTo(const Rational a) const{" function. How does that check if two rational number are equal. And this function "bool Rational::isGreaterThan(const Rational a) const {" Doesnt make any sence to me. Can someone expalin to me how the logic behind it is???
thnxk
//constructs a rational number with the given
//numerator part; denominator will be initialized to 1
Using the cross product on this and a gives the following possibilities:
first cross product = second cross product: first fraction = second fraction
first cross product < second cross product: first fraction < second fraction
first cross product > second cross product: first fraction > second fraction
Using the first identity you can fix the problem with the isEqualTo() function.