MPFR version info

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


Patrick Pelissier <Patrick.Pelissier at loria.fr> 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";
  else
    return mpfr_version ();
}

;-) ;-)

--
Torbjörn


More information about the gmp-discuss mailing list