Can someone throw some light on this line of code ...
setiosflag (ios::fixed | ios::showpoint)
and
setprecision(4)
Can someone throw some light on this line of code ...
setiosflag (ios::fixed | ios::showpoint)
and
setprecision(4)
It is used for decimal notation (like in floats).
It says to use a fixed decimal (instead of scientific notation), to use the decimal point, and to have a precision (numbers after decimal point) of 4 decimals.
Used for output formatting.
Blue
so i assume that it is not necessary to have it included.
But should i want to use setprecision(*), do i have to include the setiosflag(io::fixed | ios::showpoint.
ios::showpoint will show the decimal on all floats & doubles
without showpoint set, 4.00 may display as 4