MPFR version info

Torbjorn Granlund tg at
Mon Jul 12 17:25:28 CEST 2004

Patrick Pelissier <Patrick.Pelissier at> writes:

  > Why is it a function, and not a (read-only) variable as in
  > GMP?

   It is a function since a function is more flexible than a constant
  variable (it may be computed at linking/running time, or add
  additionnal information).

   By the way, why gmp_version is a variable rather than a function?

Because I fail to see the need of the generality of a
function for returning something as simple as this.

Perhaps it would be useful to define some procedures for
determining what mpfr version is installed even for older
releases?  Fortunately, the recurrent miscomputation bugs of
mpfr might come in useful here.  Something for the mpfr
manual, perhaps?

my_mpfr_version ()
  if (try_bug1 ())
    return "1.0";
  if (try_bug2 ())
    return "1.1";
    return mpfr_version ();

;-) ;-)


More information about the gmp-discuss mailing list