Website Summary Files Commits Branches @commit @diff @stats
path: root / src / Models / CellFormula.cpp
diff options
context:
space:
mode:
Commit7571a449b3f90e3f723488f167c25a3d095e0093 (patch)
Author
 Syndamia <kamen@syndamia.com>
2022-05-29 15:05:19 +0300
Committer
 Syndamia <kamen@syndamia.com>
2022-05-29 15:05:19 +0300
Files2a2eb796cbdaee20c038e5d765e2493793ef72c3 /src/Models/CellFormula.cpp
FMI-OOP-P2_Tables-7571a449b3f90e3f723488f167c25a3d095e0093.tar
FMI-OOP-P2_Tables-7571a449b3f90e3f723488f167c25a3d095e0093.tar.gz
FMI-OOP-P2_Tables-7571a449b3f90e3f723488f167c25a3d095e0093.zip
Parentbc8cc2c75177151a8238ff13485127ac300d52e5 (diff)
Autocommit at 29.05.2022 @ 15:05
1 files changed, 2 insertions, 2 deletions
-rw-r--r--src/Models/CellFormula.cpp4
diff --git a/src/Models/CellFormula.cpp b/src/Models/CellFormula.cpp
index fcc71a9..1ebc6d6 100644
--- a/src/Models/CellFormula.cpp
+++ b/src/Models/CellFormula.cpp
@@ -19,7 +19,7 @@ double CellFormula::calculate(unsigned index) {
switch (-formula[index++].right) {
case '+' : lval += formula[index].left->getNumeralValue(); break;
case '*' : lval *= formula[index].left->getNumeralValue(); break;
- case '/' : if (formula[index].left->getNumeralValue() == 0) throw new std::logic_error("");
+ case '/' : if (formula[index].left->getNumeralValue() == 0) throw std::logic_error("");
lval /= formula[index].left->getNumeralValue(); break;
case '^' : lval = pow(lval, formula[index].left->getNumeralValue()); break;
}
@@ -30,7 +30,7 @@ double CellFormula::calculate(unsigned index) {
case '+' : return lval + calculate(++index);
case '*' : return lval * calculate(++index);
case '/' : temp = calculate(++index);
- if (temp == 0) throw new std::logic_error("");
+ if (temp == 0) throw std::logic_error("");
return lval / temp;
case '^' : return pow(lval, calculate(++index));
case '\0' :