GNU MPFR version 3.1.3 (released on 19 June 2015)

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

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

MPFR 3.1.3 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).


The MPFR 3.1.3 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 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.



The bugs listed below have been fixed (latest update: 2015-07-17). 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. The mpfr_lngamma function gives NaN instead of +Inf on −0, on negative integers and on −Inf. This is fixed by the lngamma-and-doc patch, which also fixes and improves the tests and improves the MPFR manual concerning the special values.
    Corresponding changeset in the 3.1 branch: 9605.
  2. The mpfr_mul_2si, mpfr_div_2ui and mpfr_div_2si functions do not handle a potential overflow when the integer argument is 0; such an overflow can occur only when the output has less precision than the input, and this may yield a crash or a number with an out-of-range exponent. This is fixed by the muldiv-2exp-overflow patch, which also provides testcases.
    Corresponding changeset in the 3.1 branch: 9608.
  3. The mpfr_mul_2si, mpfr_div_2ui and mpfr_div_2si functions in rounding to nearest can round in the wrong direction when the exact result is −2emin−2, i.e. the middle of 0 and the minimum negative number in absolute value. This is fixed by the muldiv-2exp-underflow patch, which also provides testcases.
    Corresponding changeset in the 3.1 branch: 9620.
  4. The mpfr_frexp function does not handle internal overflow and it can yield an assertion failure when the current exponent range does not contain 0. This is fixed by the frexp patch, which also provides testcases.
    Corresponding changeset in the 3.1 branch: 9621.

See the tracker and the BUGS file.

Changes from version 3.1.2 to version 3.1.3

Platforms Known to Support MPFR

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

Back to the MPFR page.