code: public int compareTo(final Rational val) {
          /* Since we have always kept the denominators positive,
           * simple cross-multiplying works without changing the sign.
           */
          final BigInteger left = a.multiply(val.b);
          final BigInteger right = val.a.multiply(b);
          return left.compareTo(right);
      }
docs: Compares the value of this with another constant.
  
  @param val the other constant to compare with
  @return -1, 0 or 1 if this number is numerically less than, equal to,
  or greater than val.