"John Harrison" <jo*************@hotmail.com> wrote in message
news:2t*************@uni-berlin.de...
"Ville Ahonen" <de*****@thesubmachine.com> wrote in message
news:aQ*****************@reader1.news.jippii.net.. . I'm a total beginner at C++ so please bear with me.. When i write
cout << stddev * stddev << endl;
I get the output "4.49513e-05". How can I rephrase the above so that I
would instead get the output "0.000049513"?
cout << fixed << stddev*stddev << endl;
To elaborate:
You can also use 'setprecision(n)' to control the
number of digits after the decimal point.
'std::fixed' is declared by <ios>, and
'std::setprecision()' is declared by <iomanip>
-Mike