e>
 
 Code Example 2 (uses the "ifelse" construct):
 <pre>
 String expr = "ifelse(I<0,pow(BASE,I*0.5),pow(BASE,I))";
 MathematicalExpression.TreeNode tree = MathematicalExpression.parse(expr);
 HashMap symbols = new HashMap();
 symbols.put("BASE", new Double(2));
 for (int i = -10; i <= 10; i++) {
   symbols.put("I", new Double(i));
   double result = MathematicalExpression.evaluate(expr, symbols);
   System.out.println(expr + " and " + symbols + " = " + result);
 }
 </pre></div>
<dl><dt><span class="strong