MPFR 2.1.0 requires GMP 4.1.0 or higher.
MPFR 2.1.0 can be downloaded in the following archive formats:
Note that the patches below have not been applied.
MPFR is also available as the official Debian package libmpfr-dev. Patches 1 to 13 below have been applied in libmpfr-dev 2.1.0-5. Patch 14 below have been applied in libmpfr-dev 2.1.0-6. Patches 15 and 16 below have been applied in libmpfr-dev 2.1.0-7.
The bugs listed below have been fixed (latest update: 2005-02-21). The following instructions are for Linux and may be similar for other operating systems. You can apply the patches in several ways:
patch -N -Z -p1 < path_to_patches_filefrom the build directory. The -N option allows the patch command to ignore patches already applied. The -Z option sets the modification time of the patched files from time stamps given in the patch file, thus avoiding the need of some development utilities (such as autoconf).
mpfr_get_str
, in particular for huge exponents
(greater than 230 on 64-bit machines):
get_str patch.mpfr_sub1
internal function):
first sub1 patch.mpfr_sum
for table size less or equal to 1:
sum patch 1.mpfr_rint
(in the rounding-to-nearest mode) and
mpfr_round
functions may round in the wrong direction
when rounding in place (source and destination are the same pointer):
mpfr_rint
patch (with testcase).mpfr_exp
is very small, the sign
of the result may be wrong (if the old destination was negative):
mpfr_exp
patch (with testcase).mpfr_sum
when the destination
has a different precision from the first element of the list:
sum patch 2.mpfr_tan
function has an overflow bug, which makes
the following program loop forever:
#include <stdio.h> #include <mpfr.h> int main (void) { MPFR_DECL_INIT (x, 53); mpfr_set_emax (4); mpfr_const_pi (x, GMP_RNDD); mpfr_div_2ui (x, x, 1, GMP_RNDD); mpfr_tan (x, x, GMP_RNDD); mpfr_dump (x); return 0; }The following patch fixes this bug:
mpfr_tan
patch.mpfr_ui_sub
applied to the integer 0 and
the floating-point number +0 gives +0 instead of −0. This bug was
introduced in MPFR 2.1.0, thus it is not present in
previous MPFR versions. It is fixed by the following
patch: mpfr_ui_sub
signed-zero patch.In addition to the bugs mentioned in the BUGS file, there are possible bugs with huge precisions (greater than 230) and with exponent ranges that do not allow to represent some numbers, such as 1 or 1/2.
mpfr_strtofr
,
mpfr_set_uj
,
mpfr_set_sj
,
mpfr_set_ui_2exp
,
mpfr_set_si_2exp
,
mpfr_set_uj_2exp
,
mpfr_set_sj_2exp
,
mpfr_get_uj
,
mpfr_get_sj
,
mpfr_get_z
,
mpfr_free_str
,
mpfr_si_sub
,
mpfr_sub_si
,
mpfr_mul_si
,
mpfr_si_div
,
mpfr_div_si
,
mpfr_sqr
,
mpfr_cmp_z
,
mpfr_cmp_q
,
mpfr_zero_p
,
mpfr_free_cache
,
mpfr_sum
,
mpfr_get_version
,
mpfr_get_default_rounding_mode
,
mpfr_get_emin_min
,
mpfr_get_emin_max
,
mpfr_get_emax_min
,
mpfr_get_emax_max
,
mpfr_inits
,
mpfr_inits2
,
mpfr_clears
,
mpfr_fits_intmax_p
,
mpfr_fits_uintmax_p
,
mpfr_clear_erangeflag
,
mpfr_erangeflag_p
,
mpfr_rint_round
,
mpfr_rint_trunc
,
mpfr_rint_ceil
,
mpfr_rint_floor
.MPFR_DECL_INIT
,
MPFR_VERSION
,
MPFR_VERSION_NUM
,
MPFR_VERSION_MAJOR
,
MPFR_VERSION_MINOR
,
MPFR_VERSION_PATCHLEVEL
.ERANGE_FLAG
.mpfr_set_str
doesn't allow @NAN@garbagechar
and @INF@garbagechar
anymore, allows base 0 (detection of the
base), prefix (0x
, 0b
), leading whitespace.