In Vs2013 to_string function std::to_string(1.0e+30) provides the output 1000000000000000000000000000000.000000
In Vs2015 to_string function std::to_string(1.0e+30) provides the output 1000000000000000019884624838656.000000
If it is with standard library issue is there any fix or patch available for it?
I searched for this problem and encountered an article explains https://groups.google.com/a/isocpp.org/forum/#!topic/std-discussion/6xhWgsEuvPo to_string has bug in float or double convertion .
double d = 1.0000000000000000e+30;
std::string s = std::to_string(d);
if (s.length())
{
s;
}
here s give value as 1000000000000000019884624838656.000000
Expected result is 1000000000000000000000000000000.000000 which gives in vs2013 but not in vs2015
Aucun commentaire:
Enregistrer un commentaire