This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[PATCH] manual: Fully document the [aAeEfFgG] printf conversion specifiers.
- From: Rical Jasan <ricaljasan at pacific dot net>
- To: libc-alpha <libc-alpha at sourceware dot org>
- Date: Thu, 15 Feb 2018 23:08:18 -0800
- Subject: [PATCH] manual: Fully document the [aAeEfFgG] printf conversion specifiers.
- Authentication-results: sourceware.org; auth=none
Not all the floating-point output conversion specifiers were
documented, so make sure they are all mentioned.
* manual/stdio.texi (Formatted Output): Ensure the a, A, e, E,
f, F, g, and G conversion specifiers are all documented.
---
manual/stdio.texi | 18 ++++++++++++------
1 file changed, 12 insertions(+), 6 deletions(-)
diff --git a/manual/stdio.texi b/manual/stdio.texi
index 38be236991..4a9bde5ca1 100644
--- a/manual/stdio.texi
+++ b/manual/stdio.texi
@@ -1670,7 +1670,11 @@ Floating-point numbers can be printed in normal, fixed-point notation
using the @samp{%f} conversion or in exponential notation using the
@samp{%e} conversion. The @samp{%g} conversion uses either @samp{%e}
or @samp{%f} format, depending on what is more appropriate for the
-magnitude of the particular number.
+magnitude of the particular number. The @samp{%a} conversion prints
+the number in hexadecimal fractional notation, with a base 2 exponent
+in decimal, to provide an exact textual representation useful for
+exchange between systems. The @samp{%F}, @samp{%E}, @samp{%G}, and
+@samp{%A}, conversions are upper-case equivalents.
You can control formatting more precisely by writing @dfn{modifiers}
between the @samp{%} and the character that indicates which conversion
@@ -1836,8 +1840,9 @@ Print an integer as an unsigned hexadecimal number. @samp{%x} uses
lower-case letters and @samp{%X} uses upper-case. @xref{Integer
Conversions}, for details.
-@item @samp{%f}
+@item @samp{%f}, @samp{%F}
Print a floating-point number in normal (fixed-point) notation.
+@samp{%f} uses lower-case letters and @samp{%F} uses upper-case.
@xref{Floating-Point Conversions}, for details.
@item @samp{%e}, @samp{%E}
@@ -2056,14 +2061,15 @@ various format options, using the template string:
@subsection Floating-Point Conversions
This section discusses the conversion specifications for floating-point
-numbers: the @samp{%f}, @samp{%e}, @samp{%E}, @samp{%g}, and @samp{%G}
-conversions.
+numbers: the @samp{%f}, @samp{%F}, @samp{%e}, @samp{%E}, @samp{%g},
+@samp{%G}, @samp{%a}, and @samp{%A} conversions.
The @samp{%f} conversion prints its argument in fixed-point notation,
producing output of the form
@w{[@code{-}]@var{ddd}@code{.}@var{ddd}},
where the number of digits following the decimal point is controlled
-by the precision you specify.
+by the precision you specify. The @samp{%F} conversion will use
+upper-case letters for any special values.
The @samp{%e} conversion prints its argument in exponential notation,
producing output of the form
@@ -2106,7 +2112,7 @@ If the value to be printed represents infinity or a NaN, the output is
@w{[@code{-}]@code{inf}} or @code{nan} respectively if the conversion
specifier is @samp{%a}, @samp{%e}, @samp{%f}, or @samp{%g} and it is
@w{[@code{-}]@code{INF}} or @code{NAN} respectively if the conversion is
-@samp{%A}, @samp{%E}, or @samp{%G}.
+@samp{%A}, @samp{%E}, @samp{%F}, or @samp{%G}.
The following flags can be used to modify the behavior:
--
2.16.1