开发者

What does an 'F' in the Format specifier of printf mean?

开发者 https://www.devze.com 2023-01-21 14:38 出处:网络
What does %.8Ff format specifier in printf do?What do开发者_开发问答es F mean?According to the manual:

What does %.8Ff format specifier in printf do?

What do开发者_开发问答es F mean?


According to the manual:

The F conversion specifier produces "INF", "INFINITY", or "NAN" instead of "inf", "infinity", or "nan", respectively.

In your format string %.8Ff, the f is treated as a literal character and printed as an f.


One possible use of putting a literal f after the format specifier could be to print a string that's later to be parsed by a C or C++ compiler as a float constant instead of double constant.

0

精彩评论

暂无评论...
验证码 换一张
取 消