Package jmathexpr.arithmetic.op

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


        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();
        System.out.printf("%s = %s%n", difference, evaluated);
        assertEquals(evaluated, new LongRationalNumber(1, 6));
       
        RationalNumber sixEighth = new LongRationalNumber(6, 8);
        evaluated = sixEighth.evaluate();
View Full Code Here


        evaluated = sixEighth.evaluate();
        System.out.printf("%s = %s%n", sixEighth, evaluated);
        assertEquals(evaluated, new LongRationalNumber(3, 4));
       
        difference = new Subtraction(new LongRationalNumber(2, 3), new LongRationalNumber(1, 6));
        evaluated = difference.evaluate();
        System.out.printf("%s = %s%n", difference, evaluated);
        assertEquals(evaluated, new LongRationalNumber(1, 2));
       
        Expression product = new Multiplication(new LongRationalNumber(2, 3), new LongRationalNumber(9, 2));
        ElementOf isNatural = new ElementOf(product, N);
View Full Code Here

    public void testIntegerExpressions() {
        IntegerNumber ten = Z.create(10);
        IntegerNumber eleven = Z.create(11)
        Expression integerExpr = new Subtraction(ten, eleven);
       
        System.out.printf("%s = %s%n", integerExpr, integerExpr.evaluate());       
        assertEquals(integerExpr.evaluate(), Z.create(-1));
    }
   
    @Test
    public void testNaturalExpressions() {
View Full Code Here

        IntegerNumber ten = Z.create(10);
        IntegerNumber eleven = Z.create(11)
        Expression integerExpr = new Subtraction(ten, eleven);
       
        System.out.printf("%s = %s%n", integerExpr, integerExpr.evaluate());       
        assertEquals(integerExpr.evaluate(), Z.create(-1));
    }
   
    @Test
    public void testNaturalExpressions() {
        Expression evaluated;
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.