diff options
1 files changed, 1 insertions, 1 deletions
| -rw-r--r-- | src/Models/CellFormula.cpp | 2 |
diff --git a/src/Models/CellFormula.cpp b/src/Models/CellFormula.cpp index 4742ad1..3c40421 100644 --- a/src/Models/CellFormula.cpp +++ b/src/Models/CellFormula.cpp @@ -22,7 +22,7 @@ double CellFormula::calculate(unsigned index) const { double numVal = currCell->getNumeralValue(); while (formula[index].right < 0) { - switch (-formula[index].right) { + switch (-formula[index++].right) { case '+' : numVal += ptrByInd(formula[index].left)->getNumeralValue(); break; case '*' : numVal *= ptrByInd(formula[index].left)->getNumeralValue(); break; case '/' : if (ptrByInd(formula[index].left)->getNumeralValue() == 0) throw std::logic_error(""); |
