Alex Rivera | Logout

How do I display more decimals in the output console?

Asked 2009-08-05T07:32:30.890
16

I want to output the value of a double in it's full precision. However, when using the cout function, it only displays the first 6 digits even though there is around 15-16 digits of precision.

How do I get my program to display the entire value, including the magnitude (power) component?

Edit
Report

1 Answer

10

you could use something like this :

#include <iomanip>

cout << setprecision (9) << double_value << endl;

more iomanipulators, here

answered 2009-08-05T07:35:57.670

Your Answer