What does %.8Ff
format specifier in printf do?
What does F
mean?
views:
82answers:
2
+5
A:
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
.
codaddict
2010-10-25 04:42:46
But you're not supposed to use both like that. It will result in the `F` not being part of the conversion specification. This is probably undesired, unless you want output like INFf or NANf. :)
Matthew Flaschen
2010-10-25 04:44:13
@Matthew: Right,his `f` is a literal `f` no a part of format specifier.
codaddict
2010-10-25 04:45:11
+1
A:
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.
R..
2010-10-25 06:43:47