MPFR 2.2.1 requires GMP 4.1.0 or higher. This is the latest version of the 2.2 branch, which is no longer supported (newly discovered bugs will probably never be fixed on this branch). Please upgrade to MPFR 2.3.0 (or higher, when new versions are released): latest MPFR release.
The MPFR 2.2.1 source can be downloaded in the following archive formats:
MPFR is also available via third-party packages and ports.
The bugs listed below have been fixed (latest update: 2007-02-17). 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). Under Microsoft Windows, in addition to the above options, you may need the --binary option (this depends whether the end-of-lines have been converted when you downloaded the patch file). Also note that the --dry-run option does not work with this cumulative patch.
svn co svn://scm.gforge.inria.fr/svn/mpfr/branches/2.2 mpfr-2.2In this case, as said on the Gforge page, you should read the README.dev file for details on how to build MPFR. Also note that the branch may contain additional minor fixes.
With the first two ways, a suffix is added to the version string, so
that one can know what patches have been applied. For practical reasons,
not all the files where the version appears are patched, but the updated
version string is available with the MPFR_VERSION_STRING
macro
(header) and the mpfr_get_version
function (library).
Note: These patches are in unified diff format and some vendors' patch commands cannot deal with them; in this case, please use GNU patch (it may already be installed on your system, e.g. as /usr/local/bin/patch or gpatch).
Fixed bugs:
mpfr_init_set_ld
macro is missing. The
mpfr_init_set_ld
patch
adds it to the mpfr.h file.mpfr_set_si_2exp
and mpfr_set_ui_2exp
functions (wrong flags, and even an incorrect value in case of double
rounding). In corner cases (emin ≥ 4 and some other constraints),
the mpfr_set_si
and mpfr_set_ui
may set the
underflow flag though an underflow did not occur. These problems are fixed
by the mpfr_set_si/ui patch.mpfr_pow_si
function does not behave
correctly on some extreme cases. In particular, computing
2LONG_MIN+1 with mpfr_pow_si
can
yield a NaN. For some input
values, integer overflows may occur, but in practice, the results are
correct as long as the implementation (C compiler) guarantees two's
complement wrapping. These problems are fixed by the
mpfr_pow_si
patch. Moreover this patch
avoids a bug in Sun's compiler for Solaris/x86 (with optimizations).mpfr_dim
function (that
was added to MPFR 2.0.1).In addition to the bugs mentioned in the BUGS file:
double
floating-point type are carried out in a precision less
than the IEEE-754 double precision. This can happen on
x86 processors if the FPU is configured in single
precision mode (though one should never do that).Error in pow_si(x,x,-2) for x=2this may be a bug in your compiler, thus not an MPFR bug. Such a bug has been found in GCC preversions and in Sun's compiler for Solaris/x86 (when optimizations are enabled, which is the default when building MPFR). To avoid this compiler bug, please apply the above patches.
mpfr_fma
function behaves incorrectly if the
multiplication overflows or underflows (in the current exponent range).mpfr_gamma
on some integers.mpfr_cmp_ui
and
mpfr_cmp_si
macros used on
NaN and the constant 0 can
return an incorrect result and let the erange flag unset, because
of a bug in a gcc-specific optimization.mpfr_div
function returns an
incorrect value, which is not normalized (this can lead to an assertion
failure, or perhaps even a memory corruption). This bug is
fixed
in the trunk. See the
corresponding
tests.mpfr_div
function returns an incorrectly rounded result
in case of underflow or overflow when the quotient is negative and the
rounding mode is either GMP_RNDD
or GMP_RNDU
.mpfr_log
on some data (see
testcase).
This is
fixed
in the trunk.mpfr_asinh
on some data (see
testcase).
This is
fixed
in the trunk.make check
: much more complete generic tests.MPFR 2.2.1 has been successfully compiled and checked on the following platforms: