Package jmathexpr.arithmetic.op

Examples of jmathexpr.arithmetic.op.Addition.evaluate()


        Expression evaluated;
        RationalNumber oneHalf = new LongRationalNumber(1, 2);
        RationalNumber oneThird = new LongRationalNumber(1, 3);
        Expression sum = new Addition(oneHalf, oneThird);
       
        evaluated = sum.evaluate();
        System.out.printf("%s = %s%n", sum, evaluated);
        assertEquals(evaluated, new LongRationalNumber(5, 6));
       
        Expression difference = new Subtraction(oneHalf, oneThird);
        evaluated = difference.evaluate();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.