From cbc96e61b041e6ff713adf3885c610fdefa2023f Mon Sep 17 00:00:00 2001 From: Torbjorn Granlund Date: Thu, 24 Nov 2011 22:05:28 +0100 Subject: (Formatted Output Strings): Clarify rules for mpf_t precision. --- doc/gmp.texi | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/doc/gmp.texi b/doc/gmp.texi index 1d6538165..9e77abe7f 100644 --- a/doc/gmp.texi +++ b/doc/gmp.texi @@ -5909,7 +5909,7 @@ instance extensions registered with GLIBC @code{register_printf_function}. Also currently there's no support for POSIX @samp{$} style numbered arguments (perhaps this will be added in the future). -The precision field has it's usual meaning for integer @samp{Z} and float +The precision field has its usual meaning for integer @samp{Z} and float @samp{F} types, but is currently undefined for @samp{Q} and should not be used with that. @@ -5920,7 +5920,10 @@ happens even for an @samp{f} conversion of an @code{mpf_t} which is an integer, for instance @math{2^@W{1024}} in an @code{mpf_t} of 128 bits precision will only produce about 40 digits, then pad with zeros to the decimal point. An empty precision field like @samp{%.Fe} or @samp{%.Ff} can -be used to specifically request just the significant digits. +be used to specifically request just the significant digits. Without any dot +and thus no precision field, a precision value of 6 will be used. Note that +these rules mean that @samp{%Ff}, @samp{%.Ff}, and @samp{%.0Ff} will all be +different. The decimal point character (or string) is taken from the current locale settings on systems which provide @code{localeconv} (@pxref{Locales,, Locales -- cgit v1.2.1