205206207208209210211212213214215216
} @Override public boolean le(ANumber expr) { if (expr instanceof LongRationalNumber) { ANumber diff = subtract((LongRationalNumber) expr); return diff.isNegative() || diff.isZero(); } else { throw new IllegalArgumentException(expr.getClass() + " Expected: LongRationalNumber"); } }
216217218219220221222223224225226227
} @Override public boolean lt(ANumber expr) { if (expr instanceof LongRationalNumber) { ANumber diff = subtract((LongRationalNumber) expr); return diff.isNegative(); } else { throw new IllegalArgumentException(expr.getClass() + " Expected: LongRationalNumber"); } }
39404142434445464748
return matches; } @Override public Expression apply() { ANumber lcd = (ANumber) new Lcm(denominators).evaluate(); return new Equality(new Multiplication(lcd, ((Equality) target).lhs()), new Multiplication(lcd, ((Equality) target).rhs())); }