diff --git a/src/java/org/apache/poi/hssf/record/formula/FormulaParser.java b/src/java/org/apache/poi/hssf/record/formula/FormulaParser.java index f27e0fff0..b364cb7c2 100644 --- a/src/java/org/apache/poi/hssf/record/formula/FormulaParser.java +++ b/src/java/org/apache/poi/hssf/record/formula/FormulaParser.java @@ -310,10 +310,11 @@ public class FormulaParser { /** Parse and Translate a Math Term */ private void Term(){ Factor(); - while (Look == '*' || Look == '/' ) { + while (Look == '*' || Look == '/' || Look == '^') { ///TODO do we need to do anything here?? if (Look == '*') Multiply(); if (Look == '/') Divide(); + if (Look == '^') Power(); } } @@ -332,6 +333,12 @@ public class FormulaParser { tokens.add(new SubtractPtg()); } + private void Power() { + Match('^'); + Term(); + tokens.add(new PowerPtg()); + } + /** Parse and Translate an Expression */ private void Expression() {