[PPL-devel] Re: Why is _mp_size not of type mp_size_t?

Roberto Bagnara bagnara at cs.unipr.it
Thu Nov 3 13:17:07 CET 2005


Torbjorn Granlund wrote:
> Roberto Bagnara <bagnara at cs.unipr.it> writes:
> 
>   Notice that I am not posting this to gmp-bugs because it is not, I believe,
>   a bug of GMP: we are fiddling with the internal details of GMP and this is
>   something that goes beyond the API.  Nonetheless, I wonder why many GMP
>   functions accepts parameters of type `long int' (on non-Crays) when they
>   can never handle anything that does not fit `int'.
> 
> I'm afraid I don't follow your reasoning here.
> 
> (I don't think any mpz/mpq/mpf functions accept mp_size_t arguments.
> The _ui functions accept an (unsigned) long int but that's 32-bit or
> 64-bit numerical data, which will at most add 32 or 64 to the
> _mp_size argument.)

Maybe "many" was the wrong word.  But there are mpz and mpf
functions that accept mp_size_t arguments:

void mpz_array_init (mpz_t integer_array[], size_t array_size, mp_size_t fixed_num_bits)
void * _mpz_realloc (mpz_t integer, mp_size_t new_alloc)
mp_limb_t mpz_getlimbn (mpz_t op, mp_size_t n)
void mpz_random (mpz_t rop, mp_size_t max_size)
void mpz_random2 (mpz_t rop, mp_size_t max_size)
void mpf_random2 (mpf_t rop, mp_size_t max_size, mp_exp_t exp)

Cheers,

    Roberto

-- 
Prof. Roberto Bagnara
Computer Science Group
Department of Mathematics, University of Parma, Italy
http://www.cs.unipr.it/~bagnara/
mailto:bagnara at cs.unipr.it


More information about the gmp-discuss mailing list