Next: Converting Floats, Previous: Assigning Floats, Up: Floating-point Functions [Index]
For convenience, GMP provides a parallel series of initialize-and-set functions
which initialize the output and then store the value there. These functions’
names have the form mpf_init_set…
Once the float has been initialized by any of the mpf_init_set…
functions, it can be used as the source or destination operand for the ordinary
float functions. Don’t use an initialize-and-set function on a variable
already initialized!
Initialize rop and set its value from op.
The precision of rop will be taken from the active default precision, as
set by mpf_set_default_prec
.
Initialize rop and set its value from the string in str. See
mpf_set_str
above for details on the assignment operation.
Note that rop is initialized even if an error occurs. (I.e., you have to
call mpf_clear
for it.)
The precision of rop will be taken from the active default precision, as
set by mpf_set_default_prec
.