Wing wrote:
Hello eveyone,
I am programming some scientific computation based on C++. I would like
to set every output/input (e.g. cout, io file stream) to be a high
precision.
What C++ command should I use?
First, #include<iomanip>.
Then choose fixed-point output (cout << fixed;)
or scientific-notation output (cout << scientific;).
Finally tell the output stream how many digits of precision
you require, eg. for 12 try
cout << setprecision(12);
That's basically it. For more details read up on "manipulators".
HTH,
- J.