The boudin aux pommes release.
MPFR 3.0.0 requires GMP 4.1.0 or higher (GMP 4.2.3 or higher is recommended).
The MPFR 3.0.0 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: 2010-07-10). The patches are distributed under the same license as this version of MPFR, that is, the GNU Lesser General Public License (GNU Lesser GPL), version 3 or later.
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 source 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); this may generate a
Not setting timewarning for the PATCHES file, but you can safely ignore it. 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/3.0 mpfr-3.0In 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, the PATCHES file is modified,
so that one can know what patches have been applied, using the new
mpfr_get_patches function. Moreover a suffix is added to
the version string, but note that for practical reasons, not all the
files where the version appears are patched; thus one can also track
applied patches with the MPFR_VERSION_STRING macro (header)
and the mpfr_get_version function (library). However, if
some patches are not applied or if patches are applied in a different
order, then the patch command will fail to update some chunks, so that
the suffix is not always reliable for patches.
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, with patches:
mpfr_out_str
function is incorrect on NaN and infinities. Moreover output errors
are not handled, and if such an error occurs, the return value is
incorrect (it should have been 0). These bugs are fixed by the
mpfr_out_str patch (which also
provides additional tests of mpfr_out_str).HAVE_ALLOCA_H is not defined. This problem has been
introduced in MPFR 3.0.0.
It is fixed in the alloca patch.mpfr_gamma is incorrect.
A possible consequence is that the function can freeze. This bug is fixed
by the gamma_underflow patch (which also
provides a testcase for 32-bit machines).On some platforms (typically non-64-bit ones), mpfr_get_sj can have the following problem. If the resulting integer is a non-zero value that is small enough in absolute value, then the function can perform a right shift with a shift count larger than or equal to the width of the left operand; this has an undefined behavior. However such a shifted value is always 0 here, so that most current platforms (if not all) should be unaffected by this problem (except if compiler features to dynamically detect undefined behavior are used). This problem is fixed in the trunk (r7047).
When MPFR has been built with _GMP_IEEE_FLOATS defined (e.g. because the --with-gmp-build configure option was used), the generated code may be wrong for due to broken aliasing rules. Potentially affected functions: those that convert a MPFR number to a native floating-point number. No wrong code has actually been reported, but since some tests failed in the past for a similar bug, concerned users may want to apply the fix from the 3.0 branch (r7080).
Other bugs: please see the tracker and the BUGS file.
Note: if you are trying to build GCC and get the error header files gmp-impl.h and longlong.h not found
, please look at GCC bug 44455. This problem is a consequence of a correction in the detection of a GMP build directory.
mpfr_random
and mpfr_random2 have been removed, the meaning of the return
type of the function mpfr_get_f has changed, and the return type
of the function mpfr_get_z is now int instead of
void. In practice, this should not break any existing code.MPFR_RNDA) is available to round away
from zero.mpfr_rnd_t (as in previous
versions, both mpfr_rnd_t and mp_rnd_t are
accepted, but mp_rnd_t may be removed in the future).mpfr_prec_t (as in previous
versions, both mpfr_prec_t and mp_prec_t are
accepted, but mp_prec_t may be removed in the future) and
it is now signed (it was unsigned in MPFR 2.*, but
this was not documented). In practice, this change should not affect
existing code that assumed nothing on the precision type.mpfr_exp_t, which is currently the same as
GMP's mp_exp_t.mpfr_random and mpfr_random2
have been removed.mpfr_get_f and mpfr_get_z now return a
ternary value.mpfr_strtofr now accepts bases from 37 to 62.mpfr_custom_get_mantissa was renamed to
mpfr_custom_get_significand
(mpfr_custom_get_mantissa is still available
via a #define).mpfr_get_si, mpfr_get_ui,
mpfr_get_sj, mpfr_get_uj, mpfr_get_z
and mpfr_get_z_2exp no longer have cases with undefined
behavior; in these cases, the behavior is now specified, and in
particular, the erange flag is set.mpfr_buildopt_tls_p and
mpfr_buildopt_decimal_p giving information
about options used at MPFR build time.mpfr_regular_p.mpfr_set_zero.mpfr_digamma.mpfr_ai (incomplete, experimental).mpfr_set_flt and mpfr_get_flt
to convert from/to the float type.mpfr_urandom.mpfr_set_z_2exp (companion to
mpfr_get_z_2exp, which was renamed from
mpfr_get_z_exp in previous versions).mpfr_sin, mpfr_cos, mpfr_tan,
mpfr_sin_cos): speedup of about 2.5 for 105 digits,
of about 5 for 106 digits.arcsin, arccos, arctan):
about 2 for 103 digits, up to 2.7 for 106 digits.long double formats (double big endian, double little endian,
double-double big endian).MPFR 3.0.0 has been successfully compiled and checked on the following platforms: