hi, I already know how to use setprecision but the function wont let the round go up past 16.
#include<iostream>
#include<stdio.h>
#include<math.h>
#include<iomanip>
using namespace std;
int main ()
{
double pi = 3.14159265358979323846264338327950288419716939937510;
cout << setprecision(50) << pi << endl;
system("pause");
}
the output is just 3.1415926535897931 the code to force it to go past 16 would be something like this:
#include<iostream>
#include<stdio.h>
#include<math.h>
#include<iomanip>
using namespace std;
int main ()
{
double pi = 3.14159265358979323846264338327950288419716939937510;
cout << force_max_digits_setprecision(50) << pi << endl; //I just added "force_max_digits_"
system("pause");
}
any solutions? Thanks.