James Wanless <james at grok.ltd.uk> writes: Code should go _something_ like this (I don't pretend this is a genuine patch) File mpz/perfpow.c should replace its only function implementation, mpz_perfect_power_p, thusly: I don't follow you at all. We have quite good code for detection of perfect powers already. -- Torbjörn