#include <iostream>
#include <sstream>
#include <iomanip>
using namespace std;
int main(int argc, char *argv[])
{
double d = 3.1415926535897932384;
string str = to_string(d);//to_string()方法只能精确到小数点后6位
cout << str << endl; // 3.141593
stringstream ss;
ss << setprecision(15) << d;//一共15位
str = ss.str();
cout << str << endl; //3.14159 26535 8979
return 0;
}