In the below example the output is 3.1 so it starts at the first value.
double y = 3.14784;
cout << setprecision(2) << y;
in the following example the output precision starts at the decimal value
int x = 2;
double y = 3.0;
cout << setprecision(2) << x/y;
and yet in the following line of code - same x and y as declared above we get the precision starting not at all shown. (the only way for the below to print 6.00 is if we use fixed).
cout << setprecision(2) << x * y; // shows 6.
if we aren't using fixed - just a setprecision(n) where does that n start? because it states that its a set precision is used for decimal precision. and yet in the first example it looks at the whole double value and not just the decimal.
please advise. thanks.
n starts from the first meaningful digits(non-zero)