bug-gmp
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: const char * in mpz_get_str ? + mpz_fits_schar_p


From: Sylvain Pion
Subject: Re: const char * in mpz_get_str ? + mpz_fits_schar_p
Date: Thu, 9 May 2002 04:05:52 +0200
User-agent: Mutt/1.2.5i

On Thu, May 09, 2002 at 11:49:50AM +1000, Kevin Ryde wrote:
> > I wonder why mpz_get_str takes a char *, and not a const char *.
> > Is it a bug ?
> 
> No, the string is written there.
> 
> If you mean mpz_set_str, yes it takes a const char *, though the
> manual says char *.  (Bit slack with "const" in the manual.)

I mixed the two, yes, sorry.  It would be nice to have the "const" in the
manual though (idem for mpz_init_set_str).


> > Second thing : what about adding mpz_fits_schar_p and mpz_fits_uchar_p ?
> 
> I guess they'd match the existing routines, do you think they'd be
> useful?

I've recently put my hands on cleaning a C++ wrapper of mpz_t (yet another
one, historically based on LiDIA's wrapper it seems), and it has
BigInt.is_char() and BigInt.is_uchar(), which could be much more cleanly
implemented using such functions than with the current fragile code.

Moreover, consistency with the existing mpz_fits_* seems good.

-- 
Sylvain



reply via email to

[Prev in Thread] Current Thread [Next in Thread]