convert a gmpz to a gmpf in one call?

Richard Fateman fateman at cs.berkeley.edu
Thu Jan 26 23:32:02 CET 2006


I've written a pile of interface generic routines
for Lisp calls to various kinds of arithmetic, and
decided to try importing GMPZ and GMPF and GMPFR
arithmetic to lisp.  You can see this stuff in
http://www.cs.berkeley.edu/~fateman/generic
if you wish.  It works, and I've assigned a student
to kind of fill in the gaps. {I'm using Allegro Common
Lisp; if I knew how to convert to "Universal" FFI, it
could work on GCL etc etc}

But

I don't have a good way of doing arithmetic or
other operations on mixed types, e.g. a gmpz + a gmpf.

(in lisp it looks like ..)



currently I can convert the gmpz number to a character string and
then convert the character string to a gmpf.
This strikes me as -um- unfelicitous?

So, any nicer way of doing this?

On another note, I have found the precompiled GMP stuff on
ftp://deltatrinity.dyndns.org/
to be vastly more useful than the umpteen ways of downloading
and compiling gmp which may or may not work. (I can attest to
the "may not" part)  in trying to build a windows gmp.dll.
(yeah,yeah, I know I should use unix, esp. since I'm at
Berkeley).
I would encourage whoever is doing that deltatrinity to also
do mpfr,  especially since the mpfr people think those dlls
include mpfr and they do not :(.

Regards and thanks for all the bits.

RJF






More information about the gmp-discuss mailing list