- /*
- bool this_numeric_with_coeff_1=is_numeric_with_coeff_1();
- bool other_numeric_with_coeff_1=other.is_numeric_with_coeff_1();
- if (this_numeric_with_coeff_1) {
- if (other_numeric_with_coeff_1) {
- // both have coeff 1: compare rests
- return rest.compare(other.rest)<0;
- }
- // only this has coeff 1: >
- return false;
- } else if (other_numeric_with_coeff_1) {
- // only other has coeff 1: <
- return true;
- }
- return (rest.compare(other.rest)<0)
- || (!(other.rest.compare(rest)<0) && (coeff.compare(other.coeff)<0));
- */
- if (is_ex_exactly_of_type(rest,numeric) &&
- is_ex_exactly_of_type(other.rest,numeric)) {
- if (coeff.is_equal(ex(1))) {
- if ((other.coeff).is_equal(ex(1))) {
- // both have coeff 1: compare rests
- return rest.compare(other.rest)<0;
- }
- // only this has coeff 1: >
- return false;
- } else if ((other.coeff).is_equal(ex(1))) {
- // only other has coeff 1: <
- return true;
- }
- // neither has coeff 1: usual compare
- }
- return (rest.compare(other.rest)<0)
- || (!(other.rest.compare(rest)<0) && (coeff.compare(other.coeff)<0));