Outputting floating point numbers

The <ios> library has manipulators that alter how streams handle numbers. By default, the output stream will print floating-point numbers in a decimal format for numbers in the range 0.001 to 100000, and for numbers outside this range it will use a scientific format with a mantissa and exponent. This mixed format is the default behavior of the defaultfloat manipulator. If you always want to use scientific notation, then you should insert the scientific manipulator into the output stream. If you want to display floating point numbers using just the decimal format (that is the whole number on the left side of a decimal point and the factional part on the right side), then modify the output stream with the ...

Get Beginning C++ Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.