Hi, everyone!
What means cout.precision (4)? Who can give me
a sample to show the usage?
Thanks in advance,
George
Printable View
Hi, everyone!
What means cout.precision (4)? Who can give me
a sample to show the usage?
Thanks in advance,
George
it sets the precision of floating point numbers same as the "%.4f" formatter
example
cout.pecision(4);
cout << 445.26382011334;
will output
445.2638
Thanks, SeventhStar buddies!
George
Quote:
Originally posted by SeventhStar
it sets the precision of floating point numbers same as the "%.4f" formatter
example
cout.pecision(4);
cout << 445.26382011334;
will output
445.2638