"Tim Roberts" <t.robe...@cqu.edu.au> writes:
>                     for root in powersp:
>                             nroot = round(bignum**(1.0/root))
>                             if bignum==long(nroot)**root:
>                                                              .........
> which is probably very inefficient, but I can't see anything better.....

Actually that will not be accurate enough to know if bignum is, say, a perfect 
square.
You will have to do the small-power tests at full precision (or use a fancy 
algorithm).
Larger powers can be done with floats.
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to