Read von File!!

Hi,
I have Problem with reading a number from file. I have a number 0.8147236863931789 my program read as 0.814724. my code :

std::ifstream fin("test2.txt");
double data;
fin >> data;

I will get same number.I work long numbers as 6.3640000000000e-01.
Use the precision member function (or std::setprecision) before printing the number.

1
2
std::cout.precision(16);
std::cout << data << std::endl;


http://www.cplusplus.com/reference/ios/ios_base/precision/
http://www.cplusplus.com/reference/iomanip/setprecision/
Topic archived. No new replies allowed.