GMP v MPFR

Jim White mathimagics at yahoo.co.uk
Sat Apr 8 02:09:39 CEST 2006


Linas

Irrespective of whether or not "exact arithmetic" is
an issue for you, there is still one particularly
attractive feature of MPFR - it's rich elementary
function set.

GMP is not intended to be an elementary function
provider, so MPFR can be viewed in on sense as an easy
way to extend its real arithmetic capability - as do
various other libraries and packages that sit on top
of GMP.

With one important difference - MPFR actually uses its
own floating-point representation (ie: it doesn't use
mpf_t, it has its own mpfr_t type, similar but
different).  Just like GMP's mpf_t, it still uses the
underlying mpz_t generic types, so MPFR's float
arithmetic enjoys the same speed advantages.

There are functions to convert between mpfr_t and
mpf_t types, so ad-hoc function calls are easy, and
for more general use it's very easy to "port" any
mpf_t application so it uses mpfr_t instead.

Cheers

Jim White
ANU


More information about the gmp-discuss mailing list