How about using mpf_set_z (mpf_t rop, mpz_t op)?
Also (suppose you did) the mpz and mpf variables will need to be initialized with mpf_init(mpf_t x)and mpz_init(mpz_t x).
So you would do:
mpz_t x;
mpz_init(x);
mpf_t y;
mpf_init(y);
mpf_set_z(y,x);
user257111
source
share