Package jmathexpr.arithmetic

Examples of jmathexpr.arithmetic.ANumber


    }

    @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");
        }
    }
View Full Code Here


    }

    @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");
        }
    }
View Full Code Here

        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()));
    }
View Full Code Here

TOP

Related Classes of jmathexpr.arithmetic.ANumber

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.