This question already has an answer here:
- Is floating point math broken? 31 answers
After conversion from stringstream to double, in double variable a lot of symbols.
std::string myStr = "37.61";
stringstream stStream;
double dValue = 0.0;
stStream << myStr;
stStream >> dValue;
In the variable dValue is placed 37.609999999999999
I need 37.61
std::fixed and std::setprecision(2) dont help
Aucun commentaire:
Enregistrer un commentaire