Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
What does %.8Ff format specifier in printf do?What does F mean?
%.8Ff
F
根据手册:
F 转换说明符分别生成“INF”、“INFINITY”或“NAN”而不是“inf”、“infinity”或“nan”。
在您的格式字符串%.8Ff中,f被视为文字字符并打印为f.
f
在格式说明符之后放置文字的一种可能用途f是打印一个稍后将由 C 或 C++ 编译器解析为float常量而不是double常量的字符串。
float
double