title: Why jexl calc arithmetic wrong
body: <p>I use <a href="http://commons.apache.org/jexl/" rel="nofollow">JEXL</a> library to compute math expression with different arguments (for example y=2x+a^2-4*a*x where (x=1&amp;a=3), (x=5&amp;a=-15), etc). It works good on simple expressions, but when I start to use more hard expressions - it doesn't work. Here is code working well:</p>
  
  <pre><code>JexlEngine jexl = new JexlEngine();
  Expression func = jexl.createExpression("x1+x2");
  MapContext mc = new MapContext();
  mc.set("x1", 2);
  mc.set("x2", 1);
  System.out.println(func.evaluate(mc)); // prints "3" - GOOD ANSWER!
  </code></pre>
  
  <p>but this one print wrong answer:</p>
  
  <pre><code>JexlEngine jexl = new JexlEngine();
  Expression func = jexl.createExpression("(x1-2)^4+(x1-2*x2)^2");
  MapContext mc = new MapContext();
  mc.set("x1", 2);
  mc.set("x2", 1);
  System.out.println(func.evaluate(mc)); // prints "6" - WRONG ANSWER!
  </code></pre>
  
  <p>What I do wrong?</p>