testdouble.java
来自「JAVA 数学程序库 提供常规的数值计算程序包」· Java 代码 · 共 44 行
JAVA
44 行
package jmathlibtests.toolbox.string;
import jmathlib.core.interpreter.Interpreter;
import jmathlib.tools.junit.framework.*;
import jmathlibtests.Compare;
public class testDouble extends TestCase {
protected Interpreter ml;
public testDouble(String name) {
super(name);
}
public static void main (String[] args) {
jmathlib.tools.junit.textui.TestRunner.run (suite());
}
protected void setUp() {
ml = new Interpreter(true);
}
public static Test suite() {
return new TestSuite(testDouble.class);
}
public void testDouble01a() {
ml.executeExpression(" a=double(\"1\"); ");
assertTrue(ml.getScalarValueRe("a") == 49);
}
public void testDouble01b() {
ml.executeExpression(" a=_double(\"1\"); ");
assertTrue(ml.getScalarValueRe("a") == 49);
}
public void testDouble02a() {
double[][] b = {{97, 100, 103, 57}};
ml.executeExpression(" a=double(\"adg9\"); ");
assertTrue(Compare.ArrayEquals(b, ml.getArrayValueRe("a")));
}
public void testDouble02b() {
double[][] b = {{97, 100, 103, 57}};
ml.executeExpression(" a=_double(\"adg9\"); ");
assertTrue(Compare.ArrayEquals(b, ml.getArrayValueRe("a")));
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?