diff --git a/src/calculator.cpp b/src/calculator.cpp index 6bf781b..1f215e5 100644 --- a/src/calculator.cpp +++ b/src/calculator.cpp @@ -23,7 +23,7 @@ enum SymbolType { */ struct Symbol { SymbolType type = SymbolType::number; - double value = 0; + long double value = 0; }; /** @@ -317,7 +317,7 @@ Symbol calculateUsingStack(std::vector& _stack) { struct parseAndCalculateResult { int unmatchedParanthesis = 0; bool valid = true; - double value = 0; + long double value = 0; }; /** diff --git a/src/utils.cpp b/src/utils.cpp index 7b4a001..30fee8d 100644 --- a/src/utils.cpp +++ b/src/utils.cpp @@ -12,7 +12,7 @@ * @param precision what precision the stringed version should be * @return std::string the converted number */ -std::string doubleToString(const double& from, const int& precision = 10) { +std::string doubleToString(const long double& from, const int& precision = 10) { std::stringstream theStream; if (precision < 0) theStream << std::setprecision(std::numeric_limits::digits10+1); else theStream << std::setprecision(precision);