_ptr and _srcptr types

Vincent Lefevre vincent at vinc17.net
Mon May 14 08:44:19 UTC 2018


Hi,

On 2018-05-14 10:00:46 +0200, Emmanuel Thome wrote:
> The mpz_ptr, mpz_srcptr types, and their many friends, are exposed in
> gmp.h, but never seen in the documentation. (unless I'm mistaken.)
> 
> Well, almost:
> 
> ~/gmp $ grep 'mp[a-z]*_[a-z]*ptr' doc/gmp.texi
> @deftypefun mpz_srcptr mpz_roinit_n (mpz_t @var{x}, const mp_limb_t *@var{xp}, mp_size_t @var{xs})
> 
> (which leaves the reader a but puzzled, as mpz_srcptr is really unheard
> of in the doc).

Yes, and I'm wondering whether it should have occurred here too:

 -- Macro: mpz_t mpq_numref (const mpq_t OP)
 -- Macro: mpz_t mpq_denref (const mpq_t OP)
     Return a reference to the numerator and denominator of OP,
     respectively.  The `mpz' functions can be used on the result of
     these macros.

I'd say that if a user tries these macros to store the reference in
a mpz_t variable (instead of directly as an argument of another GMP
function), he would have a problem.

-- 
Vincent Lefèvre <vincent at vinc17.net> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)


More information about the gmp-devel mailing list