Next: Compatibility with MPF, Previous: Exceptions, Up: MPFR Interface
All the given interfaces are preliminary. They might change incompatibly in future revisions.
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 usingmpfr_init2
but has some drawbacks:
- You must not call
mpfr_clear
with variables created with this macro (The storage is allocated at the point of declaration and deallocated when the brace-level is exited.).- You can not change their precision.
- You should not create variables with huge precision with this macro.
- Your compiler must support `Non-Constant Initializers' (standard in C++ and ISO C99) and `Token Pasting' (standard in ISO C89). If prec is not a compiler constant, your compiler must support `Variable-length automatic arrays' (standard in ISO C99). `GCC 2.95.3' supports all these features.
Initialize all the
mpfr_t
variables of the givenva_list
, set their precision to be the default precision and their value to NaN. Seempfr_init
for more details. Theva_list
is assumed to be composed only of typempfr_t
. It begins from x. It ends when it encounters a null pointer.
Initialize all the
mpfr_t
variables of the givenva_list
, set their precision to be exactly prec bits and their value to NaN. Seempfr_init2
for more details. Theva_list
is assumed to be composed only of typempfr_t
. It begins from x. It ends when it encounters a null pointer.
Free the space occupied by all the
mpfr_t
variables of the givenva_list
. Seempfr_clear
for more details. Theva_list
is assumed to be composed only of typempfr_t
. It begins from x. It ends when it encounters a null pointer.
Here is an example of how to use multiple initialization functions:
{ mpfr_t x, y, z, t; mpfr_inits2 (256, x, y, z, t, (void *) 0); ... mpfr_clears (x, y, z, t, (void *) 0); }