<<< cin interpretation of 0 and 0x prefixes | Index | Manipulators for Floating-point Data Types, cont. >>> |
There are three possible ways to format floating point values
Default: cout chooses best format using n digits
cout << value // 1234.57
fixed: no exponent; n digits after the floating-point.
cout << fixed << value // 1234.56789
scientific: one digit before the decimal point plus exponent; n digits after the floating-point.
cout << scientific << value // 1.234568e+03
In fixed and scientific notations precision (discussed later) specifies exactly how many digits to display after the decimal point, even if they are trailing decimal zeros.
<<< cin interpretation of 0 and 0x prefixes | Index | Manipulators for Floating-point Data Types, cont. >>> |