Ciao,

Il Mar, 23 Ottobre 2012 10:50 pm, Torbjorn Granlund ha scritto:
> ni...@lysator.liu.se (Niels Möller) writes:
>   Torbjorn Granlund <t...@gmplib.org> writes:

>   > It is tempting to let mpz_perfect_power_p
>   > return p, but unfortunately it has type 'int' which might be too

>   > Any suggestions for a new function interface?

>        mp_bitcnt_t mpz_perfect_power_p (mpz_t x);
>
>   is mostly right. If x is a perfect power, return an exponent > 1,
>   otherwise zero.
>
> A disadvantage is that this is an incompatible change.

A possible backward compatible interface is: "Returns zero if op is not a
perfect power. Otherwise the exponent p is computed. The function returns
p if it fits in an int, or -1 if it doesn't". Not exciting, but it always
gives some information.

Regards,
Marco

-- 
http://bodrato.it/papers/

_______________________________________________
gmp-devel mailing list
gmp-devel@gmplib.org
http://gmplib.org/mailman/listinfo/gmp-devel

Reply via email to