Importing integers
Jernej Makovsek
jernej.makovsek at gmail.com
Fri Feb 6 11:38:54 CET 2009
mpz_import requires buffers, one has to be familiar with the "libs and
nails" thing for a simple operation like reading a file as a number.
I expected the library provided a single liner for doing this so I
went to mpz_inp_raw. Couldnt get it to work, went back to mpz_import
and read its section in the docus 3x. Now I too can use mpz_import :).
So, tnx for the patience, I read (from the GMP fork discussion) that
it`s a real virtue here.
Sincerely,
Jernej
On Fri, Feb 6, 2009 at 4:49 AM, Marc Glisse <marc.glisse at normalesup.org> wrote:
> On Wed, 4 Feb 2009, Jernej Makovsek wrote:
>
>> size_t mpz_inp_raw(t,file);
>
> I missed it the first time, but why would you write size_t here? You might
> want to look for a C programming book, course or tutorial, see:
> http://c-faq.com/resources/
>
> By the way, you did see that mpz_inp_raw expects to read a size before the
> actual number, right? And what is wrong with using mpz_import?
>
> --
> Marc Glisse
>
More information about the gmp-discuss
mailing list