Website Summary Files Commits Branches @commit @diff @stats
path: root / src / Models / CellFormula.cpp
diff options
context:
space:
mode:
1 files changed, 3 insertions, 3 deletions
-rw-r--r--src/Models/CellFormula.cpp6
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) {