Important notice: Problems with a particular version of MPFR are discussed in the corresponding bugs page.
The latest version of this FAQ is available at http://www.mpfr.org/faq.html.
r
to the function names, and to
specify the rounding mode (GMP_RNDN
for rounding to nearest,
GMP_RNDZ
for rounding towards zero, GMP_RNDU
for rounding towards plus infinity, GMP_RNDD
for rounding
towards minus infinity). You can also define macros as follows:
#define mpf_add(a, b, c) mpfr_add(a, b, c, GMP_RNDN)The header file mpf2mpfr.h from the MPFR distribution automatically redefines all MPF functions in this way, using the default MPFR rounding mode. Thus you simply need to add the following line in all your files using MPF functions:
#include <mpf2mpfr.h>just after the gmp.h and mpfr.h header files.
__gmpz_XXXX
,
__gmpn_XXXX
.cc link.c -lmpfr -lgmpMPFR library reference (-lmpfr) should be before GMP's one (-lgmp). Another solution is, with GNU ld, to give all the libraries inside a group:
gcc link.c -Wl,--start-group libgmp.a libmpfr.a -Wl,--end-groupSee ld manual for more details.