Hi,
When I use cout to print a double it only shows the first few digits of the mantissa. Why is that? How could I make it print the whole thing?
Seron
Hi,
When I use cout to print a double it only shows the first few digits of the mantissa. Why is that? How could I make it print the whole thing?
Seron
Use the setprecision modifier.
Output:Code:double foo = 1.123456 cout << setprecision(3) << foo << endl; cout << setprecision(7) << foo << endl;
1.12
1.123456
-Prelude
My best code is written with the delete key.
aaaha,
Thanks man!