- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我已经导入了 .jar 文件,但是
DoubleEvaluator engine = new DoubleEvaluator();
engine.defineVariable("x", -1);
engine.evaluate("Abs[x]");
向我抛出一个错误:org.matheclipse.parser.client.math.ArithmeticMathException:EvalDouble#evaluateFunction(FunctionNode) 不可能用于:Abs(x)和
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]");
}
}
最佳答案
(感谢堆栈跟踪和下载地址)
此问题已在几个小时前得到修复,最新版本应该可以解决该问题:
https://bitbucket.org/axelclk/symja_android_library/downloads/symjaMMA2016-01-09.zip
添加了缺失的 Abs 函数:
FUNCTION_DOUBLE_MAP.put("Abs", new IDouble1Function() {
public double evaluate(double arg1) {
return Math.abs(arg1);
}
});
关于java - symja 数学解析器无法识别 Abs[x],我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34698277/
这个问题已经有答案了: Is floating point math broken? (33 个回答) 已关闭 5 年前。 我正在使用Symja . 关于http://matheclipse.org/
有谁知道如何解决 Symja 中的一个简单不等式? 我这样尝试: EvalUtilities solver = new EvalUtilities(); myExpresion = "Solve[Le
我已经尝试让 Symja 在我的 Eclipse 项目中工作大约一周了,但到目前为止还没有成功。看到无数的运行时错误让我感到非常沮丧,所以我希望有人愿意帮助我深入解决这个问题。 首先,我使用“项目”-
我已经导入了 .jar 文件,但是 DoubleEvaluator engine = new DoubleEvaluator(); engine.defineVariable("x", -1); en
对于我想扩展 Elasticsearch 的项目,因此需要使用包 Symja .在 Symja 的 Github 中,有一个 manual for the usage with Maven假如。 由于
我是一名优秀的程序员,十分优秀!