From c3443aa87a7519171340be6de21608bbe3b807a9 Mon Sep 17 00:00:00 2001 From: Syndamia Date: Mon, 13 Jun 2022 20:52:41 +0300 Subject: Autocommit at 13.06.2022 @ 20:52 --- src/Models/CellInt.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/Models/CellInt.cpp') 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 { -- cgit v1.3.1-23-gd82d