Bill Allombert on Fri, 09 Dec 2005 17:48:53 +0100


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: type conversion from GEN to mpz_t (GNU mp) types


On Fri, Dec 09, 2005 at 05:08:29PM +0100, Alessio Rocchi wrote:
> Hi everybody.
> I'm trying to expand my knowledge of Pari using it with Gnu MP.

Do you know you can make libpari to use GMP internally with
./Configure --with-gmp ?

This will be probably easier and faster than using GMP mpz_t.

> Do u know any method to convert from GEN Pari type(long int*) to mpz_t type of GnuMP?
> It would be enough to know how to make GEN a simple long int (something like the GMP function mpz_get_ui()), to make GEN usable into my code.

Use itos() ("int to small", GEN to long) and stoi() ("small to int",
long to GEN).

Cheers,
Bill.