Package org.jmathml.ASTFunction

Examples of org.jmathml.ASTFunction.ASTRoot


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


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

    assertEquals(3, nodeCubeRt.evaluate(IEvaluationContext.NULL_CONTEXT).getValue(),ASTTest.TOLERANCE);
  }
 
  @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);
  }
View Full Code Here

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

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

    assertEquals(3, nodeCubeRt.evaluate(IEvaluationContext.NULL_CONTEXT).getValue(),ASTTest.TOLERANCE);
  }
 
  @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);
  }
View Full Code Here

     currEl = app;
     return true;
   }

  private void createXMLForRootDegree(ASTFunction node, Element app) {
    ASTRoot root =(ASTRoot)node;
     if(!root.isSqrt()){
     
       Element degreeEl = new Element("degree");
      
       degreeEl.setNamespace(MATHML_NS);
       Element cn = new Element("cn");
View Full Code Here

TOP

Related Classes of org.jmathml.ASTFunction.ASTRoot

Copyright © 2018 www.massapicom. 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.