From patchwork Fri Feb 16 07:08:18 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rical Jasan X-Patchwork-Id: 25947 Received: (qmail 36928 invoked by alias); 16 Feb 2018 07:08:29 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 36912 invoked by uid 89); 16 Feb 2018 07:08:28 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-25.3 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, SPF_PASS, T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy=Fully, exchange X-HELO: smtp.pacific.net From: Rical Jasan To: libc-alpha Subject: [PATCH] manual: Fully document the [aAeEfFgG] printf conversion specifiers. Date: Thu, 15 Feb 2018 23:08:18 -0800 Message-Id: <20180216070818.5205-1-ricaljasan@pacific.net> 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: