mpz_set_str

Jim White mathimagics at yahoo.co.uk
Sun Mar 26 09:20:11 CEST 2006


> I have a char buffer[5000] that contains
> characters needed to fill 3 mpz_t values.

Are there delimiters between the numbers?

Let's assume the worst case (the numbers run together)

* if the first number is 64 bytes long, save a copy of
buf[64], replace it with 0, and just pass mpz_set_str
a pointer to buf[0]

* now restore buf[64], go to the first char of the
next number, take a copy, replace it with 0, and this
time pass mpz_set_str a pointer to buf[64]


Repeat dose as required ...

Cheers

Jim White
ANU 



More information about the gmp-discuss mailing list