The following function converts a string to a double but the precision is not enough.
double stringToDouble(string s) {
double d;
stringstream ss(s); //turn the string into a stream
ss >> d; //convert
return d;
}
When called with stringToDouble("31.2458782523") the output is 31.2459.
Without using the Boost libraries is there a way to do this better? I want a higher degree of precision. As high as possible.