GNU MPFR version 3.1.2 (released on 13 March 2013)

[download] [documentation] [bugs] [changes] [platforms] [timings]

The canard à l'orange release, patch level 2.

MPFR 3.1.2 requires GMP 4.1.0 or higher (GMP 4.2.3 or higher is recommended).

Warning! Due to the fact that TLS support is now detected automatically, the MPFR build can be incorrect on some platforms (compiler or system bug). Indeed, the TLS implementation of some compilers/platforms is buggy, and MPFR cannot detect every problem at configure time. Please run make check to see if your build is affected. If you get failures, you should try the --disable-thread-safe configure option to disable TLS and see if this solves these failures. But you should not use an MPFR library with TLS disabled in a multithreaded program (unless you know what you are doing).

Download

The MPFR 3.1.2 source can be downloaded in the following archive formats:

Each tarball is signed by Vincent Lefèvre. This can be verified using the DSA key ID 98C3739D; this key can be retrieved with:

gpg --recv-keys 98C3739D

or by downloading it from https://www.vinc17.net/pgp.html. The key fingerprint is:

07F3 DBBE CC1A 3960 5078  094D 980C 1976 98C3 739D

The signatures can be verified with:

gpg --verify file.asc

You should check that the key fingerprint matches.

MPFR is also available via third-party packages and ports.

Documentation

Bugs

The bugs listed below have been fixed (latest update: 2014-04-16). 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:

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:

  1. One of the mpfr_exp implementations uses a left shift on an integer that can be negative: exps <<= 1; and this has an undefined behavior according to the ISO C standard. In most cases, this will correspond to a multiplication by 2, and the code will behave as expected (this is why the bug hadn't been detected until now). But problems may occur if a sanitizer is used (this is how this bug was detected) or possibly in case of advanced optimizations, such as LTO. This is fixed by the exp_2 patch, which corresponds to the following changeset in the 3.1 branch: 8683.
  2. The mpfr_fits_u*_p functions return 0 (doesn't fit) instead of non-zero (fits) on negative arguments for which the rounding to an integer in the given rounding mode is 0. This bug is fixed by the fits-smallneg patch, which also updates the testcases. It corresponds to the following changeset in the 3.1 branch: 8684.
  3. Some tget_flt tests fail in environments where native C floating-point division by zero is not supported, e.g. regarded as an error, such as with Clang's sanitizer; some similar tests were already disabled in such a case, but not all. The tset_ld test triggers a useless overflow on a double. These problems are fixed by the clang-divby0 patch, which also disables constant division by zero on the native C type double with Clang in order to avoid incorrect code. Corresponding changeset in the 3.1 branch: 8691.
  4. The formatted output functions (mpfr_*printf) are incorrect on the value 0 when using the alternative form (# flag), a positive precision, and the g or G conversion specifier: there is one additional trailing 0. The corresponding test is also incorrect (explaining why the bug was not detected). These problems are fixed by the printf-alt0 patch, which also provides some additional related tests. Corresponding changesets in the 3.1 branch: 8708, 8710.
  5. Only for applications using the custom interface: The mpfr_custom_init_set macro has a typo in a variable name, which can yield incorrect behavior if the second argument is not a simple expression. This bug is fixed by the custom_init_set patch. Corresponding changeset in the 3.1 branch: 8717.
  6. The li2.c build fails with the GCC -Werror=return-type option when logging has been enabled. This problem is fixed by the li2-return patch. Corresponding changeset in the 3.1 branch: 8801.
  7. The rounding of mpfr_exp can be incorrect for output precisions larger than or equal to MPFR_EXP_THRESHOLD (several thousands of bits; its value depends on the architecture). This bug is fixed by the exp3 patch, which also provides a testcase. Corresponding changeset in the 3.1 branch: 8803.
  8. This MPFR release fails to build with GMP 6 when the --with-gmp-build configure option is used. The gmp6-compat patch fixes this compatibility problem. Corresponding changeset in the 3.1 branch: 9034.

See the tracker and the BUGS file.

Changes from version 3.1.1 to version 3.1.2

Note: The official tarballs for MPFR up to 3.1.1 were affected by a vulnerability for make distcheck due to a bug in old GNU Automake versions. One of the purposes of this release is to provide tarballs without this vulnerability.

Platforms Known to Support MPFR

MPFR 3.1.2 has been successfully compiled and checked on the following platforms:

Back to the MPFR page.