I am reading from a file which has values to a precision of 7 digits in the terms of exponential values
4.81591e-007
5.17968e-007
5.03954e-008
-8.30735e-007
Though the values I am getting is with only a 5 point precision
0.000000
0.000001
0.000000
-0.000001
-0.000002
The code is as follows and is
#include<iostream>
#include<vector>
#include<utility>
#include<algorithm>
#include<map>
#include<cmath>
#include<sstream>
#include<string>
#include<queue>
#include<cstdlib>
#include<cstdio>
#include<fstream>
using namespace std;
int main()
{
FILE *fp2;
fp2=fopen("output","w");
int i=0;
ifstream myFile;
myFile.open("sruthi_DATA_.txt");
vector<long double>numberlist;
long double number;
while(myFile >> number){ //
numberlist.push_back(number);
i++;
}
int j;
for(j=0;j<i;j++)
{
cout.precision(10);
cout<<numberlist[j]<<fixed<<endl;
fprintf(fp2,"%Lf\n",numberlist[j]);
}
fclose(fp);
fclose(fp2);
return 0;
}