Next: , Previous: Exception Related Functions, Up: MPFR Interface


5.14 Advanced Functions

All the given interfaces are preliminary. They might change incompatibly in future revisions.

— Macro: MPFR_DECL_INIT (name, prec)

This macro declares name as an automatic variable of type mpfr_t, initializes it and sets its precision to be exactly prec bits and its value to NaN. name must be a valid identifier. You must use this macro in the declaration section. This macro is much faster than using mpfr_init2 but has some drawbacks:

— Function: void mpfr_inits (mpfr_t x, ...)

Initialize all the mpfr_t variables of the given va_list, set their precision to be the default precision and their value to NaN. See mpfr_init for more details. The va_list is assumed to be composed only of type mpfr_t (or equivalently mpfr_ptr). It begins from x. It ends when it encounters a null pointer (whose type must also be mpfr_ptr).

— Function: void mpfr_inits2 (mp_prec_t prec, mpfr_t x, ...)

Initialize all the mpfr_t variables of the given va_list, set their precision to be exactly prec bits and their value to NaN. See mpfr_init2 for more details. The va_list is assumed to be composed only of type mpfr_t (or equivalently mpfr_ptr). It begins from x. It ends when it encounters a null pointer (whose type must also be mpfr_ptr).

— Function: void mpfr_clears (mpfr_t x, ...)

Free the space occupied by all the mpfr_t variables of the given va_list. See mpfr_clear for more details. The va_list is assumed to be composed only of type mpfr_t (or equivalently mpfr_ptr). It begins from x. It ends when it encounters a null pointer (whose type must also be mpfr_ptr).

Here is an example of how to use multiple initialization functions:

     {
       mpfr_t x, y, z, t;
       mpfr_inits2 (256, x, y, z, t, (mpfr_ptr) 0);
       ...
       mpfr_clears (x, y, z, t, (mpfr_ptr) 0);
     }