Add companion for mpz_perfect_power_p that returns the exponent and optionally the root. Possible name mpz_rootexact. Marco suggested some alternative functions, which could test a number and extract its nth power. (Sept/Oct 2012). I saw this item under "list of planned GMP improvements" <https://gmplib.org/devel/GMPng.html> and it sounded like something I could tackle.
I have experience using gmp and writing C++ code but not a lot of experience writing clean performant C code. It would be nice to confirm that the current maintainers have time to review (and help improve) patches that I'd be writing. I thought a good first step would be to add support for the two related functions (mpz_perfect_power_p, mpz_perfect_square_p) in tune/speed which I already started on. https://github.com/sethtroisi/libgmp/pull/1/files https://patch-diff.githubusercontent.com/raw/sethtroisi/libgmp/pull/1.patch Let me know if this sounds reasonable, Seth _______________________________________________ gmp-devel mailing list gmp-devel@gmplib.org https://gmplib.org/mailman/listinfo/gmp-devel