diff options
| Commit | aecbafe786a451c202c867d0ce6cb92e7a76a5be (patch) | |
|---|---|---|
| Author | 2022-05-30 18:12:40 +0300 | |
| Committer | 2022-05-30 18:12:40 +0300 | |
| Files | cfd72c5fdd35e276436e08d0a7d037cdf147c2a1 /src | |
| FMI-OOP-P2_Tables-aecbafe786a451c202c867d0ce6cb92e7a76a5be.tar FMI-OOP-P2_Tables-aecbafe786a451c202c867d0ce6cb92e7a76a5be.tar.gz FMI-OOP-P2_Tables-aecbafe786a451c202c867d0ce6cb92e7a76a5be.zip | ||
| Parent | abb9700d4d45cf85d04759b76bd93a795e0f467e (diff) | |
Autocommit at 30.05.2022 @ 18:12
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(""); |
