casevh <cas...@gmail.com> writes: > gmpy.is_square() is quite fast. On a older 32-bit Linux box, it can > test approximately 400,000 100-digits numbers per second. The time > includes conversion from a string. If the numbers are already Python > longs, it can check 800,000 per second. Checking a billion is not > unreasonable.
Wow, that is pretty impressive. A look at the code shows it uses quite a few optimizations: http://sage.math.washington.edu/home/novoselt/gmp-4.2.4/mpn/perfsqr.c -- http://mail.python.org/mailman/listinfo/python-list