can't calculate ln(e)

17 views
Skip to first unread message

Antonyo Jaydenx

unread,
Apr 20, 2019, 4:09:15 PM4/20/19
to Jep Java Users
public static void main(String[] args) {
        JEP j= new JEP();
        j.addStandardConstants();
        j.addComplex();
        j.addVariable("x", 1); // 1 va  a ser el valor de la expresion x
        j.parseExpression("x^2-2*ln(e)"); // el valor sera pasado por esta ecuacion
        
        System.out.println(j.getValue());
        
        
    }



it only say me "Nan"

Richard Morris

unread,
Apr 21, 2019, 4:58:40 AM4/21/19
to Jep Java Users
You need to add in the set of functions. 

        j.addStandardFunctions();

currently its treating 'ln' as an undeclared variable, so the expression is 'x^2-2*ln * e'. 
Reply all
Reply to author
Forward
0 new messages