/** * Compares this expression with the specified expression for order. Returns a negative integer, zero, or a positive * integer as this expression is canonical less than, equal to, or greater than the specified expression. */ @Override public int compareTo(final IExpr expr) { if (expr instanceof ComplexNum) { return compareTo(((ComplexNum) expr).fComplex); } return IComplexNum.super.compareTo(expr); }
/** * Compares this expression with the specified expression for order. Returns a * negative integer, zero, or a positive integer as this expression is * canonical less than, equal to, or greater than the specified expression. */ public int compareTo(final IExpr obj) { if (obj instanceof ComplexNum) { return compareTo(((ComplexNum) obj).fComplex); // return fComplex.compareTo(((DoubleComplexImpl) obj).fComplex); } return (hierarchy() - (obj).hierarchy()); }