t access macros.

   When using any of these functions, you must include the `<stdio.h>'
standard header before `mpfr.h', to allow `mpfr.h' to define prototypes
for these functions.

5.9.2 Format String
-------------------

The format specification accepted by `mpfr_printf' is an extension of
the `printf' one. The conversion specification is of the form:
     % [flags] [width] [.[precision]] [type] [rounding] conv
   `flags', `width', and `precision' have the same meaning as for the
standard `printf' (in particular, notice that the `precision' is
related to the number of digits displayed in the base chosen by `conv'
and not related to the internal precision of the `mpfr_t' variable).
`mpfr_printf' accepts the same `type' specifiers as GMP (except the
non-standard and deprecated `q', use `ll' instead), plus `R' and `P':

     `h'       `short'
     `hh'      `char'
     `j'       `intmax_t' or `uintmax_t'
     `l'       `long' or `wchar_t'
     `ll'      `long long'
     `L'       `long double'
     `t'       `ptrdiff_t'
     `z'       `size_t'
     `F'       `mpf_t', float conversions
     `Q'       `mpq_t', integer conversions
     `M'       `mp_limb_t', integer conversions
     `N'       `mp_limb_t' array, integer conversions
     `Z'       `mpz_t', integer conversions
     `P'       `mp_prec_t', integer conversions
     `R'       `mpfr_t', float conversions

   The `type' specifiers have the same restrictions as those mentioned
in the GMP documentation: *note Formatted Output Strings:
(gmp.info)Formatted Output Strings.  In particular, the `type'
specifiers (except `R' and `P' defined by MPFR) are supported only if
they are supported by `gmp_printf' in your GMP build; this implies that
the standard specifiers, such as `t', must _also_ be supported by your
C library if you want to use them.

   The `rounding' field is specific to `mpfr_t' arguments and should
not be used with other types.

   With conversion specification not involving `P' and `R' types,
`mpfr_printf' behaves exactly as `gmp_printf'.

   The `P' type specifies that a following `o', `u', `x', or `X'
conversion specifier applies to a `mp_prec_t' argument.  It is needed
because the `mp_prec_t' type does not necessarily correspond to an
`unsigned int' or any fixed standard type.  The `precision' field
specifies the minimum number of digits to appear. The default
`precision' is 1.  For example:
     mpfr_t x;
     mp_prec_t p;
     mpfr_init (x);
     ...
     p = mpfr_get_prec (x);
     mpfr_printf ("variable x with %Pu bits", p);

   The `R' type specifies that a following `a', `A', `b', `e', `E',
`f', `F', `g', `G', or `n' conversion specifier applies to a `mpfr_t'
argument.  The `R' type can be followed by a `rounding' specifier
denoted by one of the following characters:

     `U'       round toward plus infinity
     `D'       round toward minus infinity
     `Z'       round toward zero
     `N'       round to nearest
     `*'       rounding mode indicated by the
               `mp_rnd_t' argument just before the
               corresponding `mpfr_t' variable.

   The default rounding mode is rounding to nearest.  The following
three examples are equivalent:
     mpfr_t x;
     mpfr_init (x);
     ...
     mpfr_printf ("%.128Rf", x);
     mpfr_printf ("%.128RNf", x);
     mpfr_printf ("%.128R*f", GMP_RNDN, x);

   The output `conv' specifiers allowed with `mpfr_t' parameter are:

     `a' `A'   hex float, C99 style
     `b'       binary output
     `e' `E'   scientific format float
     `f' `F'   fixed point float
     `g' `G'   fixed or scientific float

   The conversion specifier `b' which displays the argument in binary is
specific to `mpfr_t' arguments and should not be used with other types.
Other conversion specifiers have the same meaning as for a `double'
argument.

   In case of non-decimal output, only the significand is written in the
specified base, the exponent is always displayed in decimal.  Special
values are always displayed as `nan', `-inf', and `inf' for `a', `b',
`e', `f', and `g' specifiers and `NAN', `-INF', and `INF' for `A', `E',
`F', and `G' specifiers.

   If the `precision' field is not empty, the `mpfr_t' number is
rounded to the given precision in the direction specified by the
rounding mode.  If the precision is zero with rounding to nearest mode
and one of the following `conv' specifier: `a', `A', `b', `e', `E', tie
case is rounded to even when it lies between two values at the wanted
precision which have the same exponent, otherwise, it is rounded away
from zero.  For instance, 85 is displayed as "8e+1" and 95 is displayed
as "1e+2" with the format specification `"%.0RNe"'.  This also applies
when the `g' (resp. `G') conversion specifier uses the `e' (resp. `E')
style.  If the precision is set to a value greater than the maximum
value for an `int', it will be silently reduced down to `INT_MAX'.

   If the `precision' field is empty (as in `%Re' or `%.Re') with
`conv' specifier `e' and `E', the number is displayed with enough
digits so that it can be read back exactly, assuming that the input and
output variables have the same precision and that the input and output
rounding modes are both rounding to nearest (as for `mpfr_get_str').
The default precision for an empty `precision' field with `conv'
specifiers `f', `F', `g', and `G' is 6.

5.9.3 Functions
---------------

 -- Function: int mpfr_fprintf (FILE *STREAM, const char *TEMPLATE, ...)
 -- Function: int mpfr_vfprintf (FILE *STREAM, const char *TEMPLATE,
          va_list AP)
     Print to the stream STREAM the optional arguments under the
     control of the template string TEMPLATE.

     Return the number of characters written or a negative value if an
     error occurred. If the number of characters which ought to be
     written appears to exceed the maximum limit for an `int', nothing
     is written in the stream, the function returns -1, sets the
     _erange_ flag, and (in POSIX system only) `errno' is set to
     `EOVERFLOW'.

 -- Function: int mpfr_printf (const char *TEMPLATE, ...)
 -- Function: int mpfr_vprintf (const char *TEMPLATE, va_list AP)
     Print to `stdout' the optional arguments under the control of the
     template string TEMPLATE.

     Return the number of characters written or a negative value if an
     error occurred. If the number of characters which ought to be
     written appears to exceed the maximum limit for an `int', nothing
     is written in `stdout', the function returns -1, sets the _erange_
     flag, and (in POSIX system only) `errno' is set to `EOVERFLOW'.

 -- Function: int mpfr_sprintf (char *BUF, const char *TEMPLATE, ...)
 -- Function: int mpfr_vsprintf (char *BUF, const char *TEMPLATE,
          va_list AP)
     Form a null-terminated string in BUF. No overlap is permitted
     between BUF and the other arguments.

     Return the number of characters written in the array BUF not
     counting the terminating null character or a negative value if an
     error occurred. If the number of characters which ought to be
     written appears to exceed the maximum limit for an `int', nothing
     is written in BUF, the function returns -1, sets the _erange_
     flag, and (in POSIX system only) `errno' is set to `EOVERFLOW'.

 -- Function: int mpfr_snprintf (char *BUF, size_t N, const char
          *TEMPLATE, ...)
 -- Function: int mpfr_vsnprintf (char *BUF, size_t N, const char
          *TEMPLATE, va_list AP)
     Form a null-terminated string in BUF. If N is zero, nothing is
     written and BUF may be a null pointer, otherwise, the `n-1' first
     characters are written in BUF and the N-th is a null character.

     Return the number of characters that would have been written had N
     be sufficiently large, not counting the terminating null character
     or a negative value if an error occurred. If the number of
     characters produced by the optional arguments under the control of
     the template string TEMPLATE appears to exceed the maximum limit
     for an `int', nothing is written in BUF, the function returns -1,
     sets the _erange_ flag, and (in POSIX system only) `errno' is set
     to `EOVERFLOW'.

 -- Function: int mpfr_asprintf (char **STR, const char *TEMPLATE, ...)
 -- Function: int mpfr_vasprintf (char **STR, const char *TEMPLATE,
          va_list AP)
     Write their output as a null terminated string in a block of
     memory allocated using the current allocation function. A pointer
     to the block is stored in STR. The block of memory must be freed
     using `mpfr_free_str'.

     The return value is the number of characters written in the
     string, excluding the null-terminator or a negative value if an
     error occurred. If the number of characters produced by the
     optional arguments under the control of the template string
     TEMPLATE appears to exceed the maximum limit for an `int', STR is
     a null pointer, the function returns -1, sets the _erange_ flag,
     and (in POSIX system only) `errno' is set to `EOVERFLOW'.

