Website Summary Files Commits Branches @commit @diff @stats
path: root / src / Models / CellDouble.cpp
diff options
context:
space:
mode:
Commit067612cecd7d91159177b421366476134af0247d (patch)
Author
 Syndamia <kamen@syndamia.com>
2022-06-14 09:03:55 +0300
Committer
 Syndamia <kamen@syndamia.com>
2022-06-14 09:03:55 +0300
Filesf0dea2f47d74053a4d25c3fdec493f6c1b3e68d3 /src/Models/CellDouble.cpp
FMI-OOP-P2_Tables-067612cecd7d91159177b421366476134af0247d.tar
FMI-OOP-P2_Tables-067612cecd7d91159177b421366476134af0247d.tar.gz
FMI-OOP-P2_Tables-067612cecd7d91159177b421366476134af0247d.zip
Parent41b5f9891b2758193d8ec4d524f5f4b1dc27ec53 (diff)
Autocommit at 14.06.2022 @ 09:03
1 files changed, 3 insertions, 5 deletions
-rw-r--r--src/Models/CellDouble.cpp8
diff --git a/src/Models/CellDouble.cpp b/src/Models/CellDouble.cpp
index c1f90f7..538bf11 100644
--- a/src/Models/CellDouble.cpp
+++ b/src/Models/CellDouble.cpp
@@ -5,18 +5,16 @@ CellDouble::CellDouble(double value) {
this->value = value;
}
-#include <iostream>
CellDouble::CellDouble(const char* str) {
- std::cout << "Double: " << str << std::endl;
value = 0;
- bool negative = (*str == '-');
+ bool negative = *str == '-';
if (*str == '-' || *str == '+') str++;
while (*str != '.')
- value = value * 10 + ('0' - *(str++));
+ value = value * 10 + (*(str++) - '0');
str++;
for (unsigned div = 10; *str != '\0'; div *= 10)
- value += (double)('0' - *(str++)) / div;
+ value += (double)(*(str++) - '0') / div;
if (negative) value *= -1;
}