Website Summary Files Commits Branches @commit @diff @stats
path: root / src / Models / CellInt.cpp
diff options
context:
space:
mode:
Commitc3443aa87a7519171340be6de21608bbe3b807a9 (patch)
Author
 Syndamia <kamen@syndamia.com>
2022-06-13 20:52:41 +0300
Committer
 Syndamia <kamen@syndamia.com>
2022-06-13 20:52:41 +0300
Filesbd79a8060f7aa4adbacd6991600b6eac831c7fee /src/Models/CellInt.cpp
FMI-OOP-P2_Tables-c3443aa87a7519171340be6de21608bbe3b807a9.tar
FMI-OOP-P2_Tables-c3443aa87a7519171340be6de21608bbe3b807a9.tar.gz
FMI-OOP-P2_Tables-c3443aa87a7519171340be6de21608bbe3b807a9.zip
Parentb51956b8f98f6fbfb341df0a81f159a7425fac2b (diff)
Autocommit at 13.06.2022 @ 20:52
1 files changed, 5 insertions, 0 deletions
-rw-r--r--src/Models/CellInt.cpp5
diff --git a/src/Models/CellInt.cpp b/src/Models/CellInt.cpp
index 827f346..a20c5ed 100644
--- a/src/Models/CellInt.cpp
+++ b/src/Models/CellInt.cpp
@@ -7,8 +7,13 @@ CellInt::CellInt(int value) {
CellInt::CellInt(const char* str) {
value = 0;
+ bool negative = *str == '-';
+ if (*str == '-' || *str == '+') str++;
+
while (*str != '\0')
value = value * 10 + '0' - *(str++);
+
+ if (negative) value *= -1;
}
double CellInt::getNumeralValue() const {