Website Summary Files Commits Branches @commit @diff @stats
path: root / src
diff options
context:
space:
mode:
2 files changed, 2 insertions, 2 deletions
-rw-r--r--src/Models/CellFormula.cpp2
-rw-r--r--src/main.cpp2
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();