[prev in list] [next in list] [prev in thread] [next in thread] 

List:       gmp-discuss
Subject:    [PPL-devel] Re: Why is _mp_size not of type mp_size_t?
From:       bagnara () cs ! unipr ! it (Roberto Bagnara)
Date:       2005-11-03 12:17:07
Message-ID: 4369FFC3.80705 () cs ! unipr ! it
[Download RAW message or body]

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

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic