diff options
| Commit | 08df0c2e39e87512d0f83732cddf8ee26050d8d3 (patch) | |
|---|---|---|
| Author | 2022-05-29 10:29:33 +0300 | |
| Committer | 2022-05-29 10:29:33 +0300 | |
| Files | 9b4f2aeeac4dabd5bbe27dceafb7625faff90af4 /src | |
| FMI-OOP-P2_Tables-08df0c2e39e87512d0f83732cddf8ee26050d8d3.tar FMI-OOP-P2_Tables-08df0c2e39e87512d0f83732cddf8ee26050d8d3.tar.gz FMI-OOP-P2_Tables-08df0c2e39e87512d0f83732cddf8ee26050d8d3.zip | ||
| Parent | 1da2355d59383939e49db2ac12de6097b7372bdb (diff) | |
Autocommit at 29.05.2022 @ 10:29
2 files changed, 4 insertions, 4 deletions
| -rw-r--r-- | src/Models/CellFormula.cpp | 6 | ||||
| -rw-r--r-- | src/main.cpp | 2 |
diff --git a/src/Models/CellFormula.cpp b/src/Models/CellFormula.cpp index caa1f5d..2425ea8 100644 --- a/src/Models/CellFormula.cpp +++ b/src/Models/CellFormula.cpp @@ -3,12 +3,12 @@ #include <cstring> #include <iostream> double pow(double x, unsigned y) { - std::cout << x << " " << y << std::endl; if (y == 0) return 1; + double res = x; for (unsigned i = 1; i < y; i++) - x *= x; - return x; + res *= x; + return res; } double CellFormula::calculate(unsigned index) { diff --git a/src/main.cpp b/src/main.cpp index caa2e19..b0185d3 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -5,7 +5,7 @@ int main() { table.putCell(0, 0, "8"); table.putCell(0, 1, "3"); table.putCell(0, 2, "String"); - table.putCell(0, 3, "= 2 ^ 10"); + table.putCell(0, 3, "= 3 * R0C1 + R0C0 ^ R0C1 * 9 - 10"); UserInterface ui(&table); ui.run(); } |
