use long double instead of double
This commit is contained in:
parent
59d9ddd593
commit
bd9976fb6f
2 changed files with 3 additions and 3 deletions
|
@ -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<Symbol>& _stack) {
|
|||
struct parseAndCalculateResult {
|
||||
int unmatchedParanthesis = 0;
|
||||
bool valid = true;
|
||||
double value = 0;
|
||||
long double value = 0;
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
@ -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<double>::digits10+1);
|
||||
else theStream << std::setprecision(precision);
|
||||
|
|
Reference in a new issue