我已经导入了 .jar 文件,但是
DoubleEvaluator engine = new DoubleEvaluator();
engine.defineVariable("x", -1);
engine.evaluate("Abs[x]");
给我一个错误:org.matheclipse.parser.client.math.ArithmeticMathException: EvalDouble#evaluateFunction(FunctionNode) not possible for: Abs(x) and
engine.evaluate("Sin[x]");
才不是。这可能是什么原因?
Exception in thread "main" org.matheclipse.parser.client.math.ArithmeticMathException: EvalDouble#evaluateFunction(FunctionNode) not possible for: Abs(x)
at org.matheclipse.parser.client.eval.DoubleEvaluator.evaluateFunction(DoubleEvaluator.java:563)
at org.matheclipse.parser.client.eval.DoubleEvaluator.evaluateNode(DoubleEvaluator.java:493)
at org.matheclipse.parser.client.eval.DoubleEvaluator.evaluate(DoubleEvaluator.java:460)
at javaapplication14.JavaApplication14.main(JavaApplication14.java:24)
Java Result: 1
并且示例运行
import org.matheclipse.parser.client.eval.DoubleEvaluator;
public class application {
public static void main(String[] args) {
DoubleEvaluator engine = new DoubleEvaluator();
engine.defineVariable("x",-1);
engine.evaluate("Abs[x]");
}
}