std::showpoint
ios_base& showpoint (ios_base& str);
Show decimal point
Sets the
showpoint format flag for the
str stream.
When the showpoint format flag is set, the decimal point is always written for floating point values inserted into the stream (even for those whose decimal part is zero). Following the decimal point, as many digits as necessary are written to match the precision set for the stream (if any).
This flag can be unset with the noshowpoint manipulator. When not set, the decimal point is only written for numbers whose decimal part is not zero.
The precision setting can be modified using the precision member function.
For standard streams, the showpoint flag is not set on initialization.
本文详细解释了C++中std::showpoint标志的功能及其使用方法,特别是如何控制浮点数值在输出到流时是否显示小数点。
403

被折叠的 条评论
为什么被折叠?



