convert a gmpz to a gmpf in one call?

Richard Fateman fateman at
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
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}


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
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
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.


More information about the gmp-discuss mailing list