From 36dfbb2bb4155194d42a8d7245d64f0da11bd847 Mon Sep 17 00:00:00 2001 From: Syndamia Date: Sun, 29 May 2022 14:15:01 +0300 Subject: Autocommit at 29.05.2022 @ 14:15 --- src/Models/CellFormula.cpp | 2 +- src/main.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src') 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& 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(); -- cgit v1.3.1-23-gd82d