Package org.jmathml.ASTFunction

Examples of org.jmathml.ASTFunction.ASTRoot.evaluate()


 
  @Test
  public void testSQRT() {
    ASTRoot nodesqrt = ASTFunction.createASTRoot(2);
    nodesqrt.addChildNode(ASTNumber.createNumber(36));
    assertEquals(6, nodesqrt.evaluate(IEvaluationContext.NULL_CONTEXT).getValue(),ASTTest.TOLERANCE);
  }
 
  @Test
  public void testRootWithOneChildIsSqRoot() {
    ASTFunction nodesqrt = ASTFunction.createFunctionNode(ASTFunctionType.ROOT);
View Full Code Here


 
  @Test
  public void testCubeRoot() {
    ASTRoot nodeCubeRt = ASTFunction.createASTRoot(3);
    nodeCubeRt.addChildNode(ASTNumber.createNumber(27));
    assertEquals(3, nodeCubeRt.evaluate(IEvaluationContext.NULL_CONTEXT).getValue(),ASTTest.TOLERANCE);
  }
 
  @Test
  public void testNthRoot() {
    ASTRoot nthRt = ASTFunction.createASTRoot(5);
View Full Code Here

 
  @Test
  public void testNthRoot() {
    ASTRoot nthRt = ASTFunction.createASTRoot(5);
    nthRt.addChildNode(ASTNumber.createNumber(3125)); //number
    assertEquals(5, nthRt.evaluate(IEvaluationContext.NULL_CONTEXT).getValue(),ASTTest.TOLERANCE);
  }
 
  @Test
  public void testExp() {
    ASTFunction exp = ASTFunction.createFunctionNode(ASTFunctionType.EXP);
View Full Code Here

 
  @Test
  public void testSQRT() {
    ASTRoot nodesqrt = ASTFunction.createASTRoot(2);
    nodesqrt.addChildNode(ASTNumber.createNumber(36));
    assertEquals(6, nodesqrt.evaluate(IEvaluationContext.NULL_CONTEXT).getValue(),ASTTest.TOLERANCE);
  }
 
  @Test
  public void testRootWithOneChildIsSqRoot() {
    ASTFunction nodesqrt = ASTFunction.createFunctionNode(ASTFunctionType.ROOT);
View Full Code Here

 
  @Test
  public void testCubeRoot() {
    ASTRoot nodeCubeRt = ASTFunction.createASTRoot(3);
    nodeCubeRt.addChildNode(ASTNumber.createNumber(27));
    assertEquals(3, nodeCubeRt.evaluate(IEvaluationContext.NULL_CONTEXT).getValue(),ASTTest.TOLERANCE);
  }
 
  @Test
  public void testNthRoot() {
    ASTRoot nthRt = ASTFunction.createASTRoot(5);
View Full Code Here

 
  @Test
  public void testNthRoot() {
    ASTRoot nthRt = ASTFunction.createASTRoot(5);
    nthRt.addChildNode(ASTNumber.createNumber(3125)); //number
    assertEquals(5, nthRt.evaluate(IEvaluationContext.NULL_CONTEXT).getValue(),ASTTest.TOLERANCE);
  }
 
  @Test
  public void testExp() {
    ASTFunction exp = ASTFunction.createFunctionNode(ASTFunctionType.EXP);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.