Convert rational to fixed-point decimal number

Paul Zimmermann Paul.Zimmermann at
Sun Feb 28 21:27:15 CET 2010

> > I try to use mpq_ functions in my program. How can I convert mpq_t
> > type to fixed-point decimal number without loss precision (without
> > using double IEEE)?
> Torbjorn> I am not sure what function you need.
> It sounds like what he wants gmp_printf(3).

maybe MPFR ( solves the original problem, more precisely the
mpfr_set_q function.

Paul Zimmermann

PS: is currently down, maybe due to the Xynthia storm.
You can also download MPFR from

More information about the gmp-discuss mailing list