Package jmathexpr.arithmetic.func

Examples of jmathexpr.arithmetic.func.Exp


   
    @Test(dependsOnMethods = { "testSum" })
    public void testFunctions() {
        Expression evaluated;
        Variable x = Numbers.variable("x");
        Function exp = new Exp(x);
        System.out.printf("%s%n", exp);
       
        x.setValue(R.create(0));
        evaluated = exp.evaluate();
        System.out.printf("  %s%n", evaluated);
        assertEquals(evaluated, Naturals.one());
       
        x.setValue(R.create(1));
        System.out.printf("  %s%n", exp.evaluate());
       
        Function log = new Log(N.create(10), N.create(1000));
        evaluated = log.evaluate();
        System.out.printf("%s = %s%n", log, evaluated);
        assertEquals(evaluated, N.create(3));
View Full Code Here


        String function = ctx.FUNC().getText();
        Expression arg = stack.pop();
       
        switch (function) {
            case "exp":
                stack.push(new Exp(arg));
                break;
           
            case "ln":
                stack.push(new Ln(arg));
                break;
View Full Code Here

TOP

Related Classes of jmathexpr.arithmetic.func.Exp

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.