diff options
| Commit | 36dfbb2bb4155194d42a8d7245d64f0da11bd847 (patch) | |
|---|---|---|
| Author | 2022-05-29 14:15:01 +0300 | |
| Committer | 2022-05-29 14:15:01 +0300 | |
| Files | fe22d8dd46e77d482e58747510e704f5f1fac368 /src | |
| FMI-OOP-P2_Tables-36dfbb2bb4155194d42a8d7245d64f0da11bd847.tar FMI-OOP-P2_Tables-36dfbb2bb4155194d42a8d7245d64f0da11bd847.tar.gz FMI-OOP-P2_Tables-36dfbb2bb4155194d42a8d7245d64f0da11bd847.zip | ||
| Parent | 56bdda6704c7009e481667b0e15ea45cbaf986f4 (diff) | |
Autocommit at 29.05.2022 @ 14:15
2 files changed, 2 insertions, 2 deletions
| -rw-r--r-- | src/Models/CellFormula.cpp | 2 | ||||
| -rw-r--r-- | src/main.cpp | 2 |
diff --git a/src/Models/CellFormula.cpp b/src/Models/CellFormula.cpp index 76c9150..fda6ed2 100644 --- a/src/Models/CellFormula.cpp +++ b/src/Models/CellFormula.cpp @@ -83,7 +83,7 @@ void CellFormula::parseAndSetValue(const char* str) { if (currOp == '^') currOp *= -1; else if ((currOp == '+' || currOp == '-') && formula.get_count() != 0) { Pair<Cell*, char>& prev = formula[formula.get_count() - 1]; - if (prev.right == '*' || prev.right == '/' || prev.right == '-') prev.right *= -1; + if (prev.right == '*' || prev.right == '/') prev.right *= -1; } formula.add({cellToAdd, currOp}); diff --git a/src/main.cpp b/src/main.cpp index 66e2b1a..624d54e 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -5,7 +5,7 @@ int main() { table.putCell(0, 0, "8.6"); table.putCell(0, 1, "3"); table.putCell(0, 2, "String"); - table.putCell(0, 3, "= 3 * R0C1 + R0C0 ^ R0C1 * 9 - 10 * 2 + 1"); + table.putCell(0, 3, "= 3 * R0C1 + R0C0 ^ R0C1 * 9 - 2 * 10 + 1"); // table.putCell(0, 3, "= 1 + 2 * 3 + 4 + 5"); UserInterface ui(&table); ui.run(); |
