Re: integer square roots

2009-07-24 Thread timro21
Thanks to all! Tim -- http://mail.python.org/mailman/listinfo/python-list

Re: integer square roots

2009-07-23 Thread timro21
Bloody 'ell - thanks. :-) -- http://mail.python.org/mailman/listinfo/python-list

Re: integer square roots

2009-07-23 Thread casevh
On Jul 23, 9:43 pm, timro21 wrote: > Hi Tim, sure, I'm looking at the perfect cuboid problem. > > I've just spent a couple of very frustrating hours.  Given that I'm in > my 50's but have the brain of a retarded 3-year-old, can someone > please explain what I have to do to download gmpy to use wit

Re: integer square roots

2009-07-23 Thread timro21
Hi Tim, sure, I'm looking at the perfect cuboid problem. I've just spent a couple of very frustrating hours. Given that I'm in my 50's but have the brain of a retarded 3-year-old, can someone please explain what I have to do to download gmpy to use with ActivePython 2.6 on a Windows system? I do

Re: integer square roots

2009-07-23 Thread Tim Daneliuk
timro21 wrote: > Thanks to all! > > Tim While we're at it, would you mind saying more about what exactly you're doing - Inquiring Math Dorks (tm) want to know ... -- Tim Daneliuk tun...@tundraware.com PGP Key:

Re: integer square roots

2009-07-23 Thread Paul Rubin
casevh 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 > unr

Re: integer square roots

2009-07-23 Thread casevh
> comp.lang.python is a good place to get answers about Python.  It's > probably not such a good source of answers about computational number > theory.  Also, Python is more about productivity than speed, so > answers involving Python may not be the most efficient possible > answers.  One obvious p

Re: integer square roots

2009-07-23 Thread Paul Rubin
timro21 writes: > Homework? Gosh no. I have several number theory applications which > need to know (quickly) whether particular very large numbers are > perfect squares. Since I asked this in this newsgroup I guess I > assumed that responses wuld relate specifically to how to do this > efficie

Re: integer square roots

2009-07-23 Thread timro21
On Jul 24, 10:35 am, Paul Rubin wrote: > timro21 writes: > > I wish to process billions of 100-digit numbers and test if each has > > an integer square root.  What's the most efficient way to do this? > > Is this a homework problem?  If not, may I ask what the applic

Re: integer square roots

2009-07-23 Thread Paul Rubin
timro21 writes: > I wish to process billions of 100-digit numbers and test if each has > an integer square root. What's the most efficient way to do this? Is this a homework problem? If not, may I ask what the application is? I think the basic answer is 1) use the law of quadratic reciprocity

Re: integer square roots

2009-07-23 Thread Mensanator
On Jul 23, 7:17 pm, Mensanator wrote: > On Jul 23, 7:11 pm, Mensanator wrote: > > > > > > > On Jul 23, 6:02 pm, timro21 wrote: > > > > I wish to process billions of 100-digit numbers and test if each has > > > an integer square root.  What's the most efficient way to do this? > > > Use gmpy. > >

Re: integer square roots

2009-07-23 Thread Mensanator
On Jul 23, 7:11 pm, Mensanator wrote: > On Jul 23, 6:02 pm, timro21 wrote: > > > I wish to process billions of 100-digit numbers and test if each has > > an integer square root.  What's the most efficient way to do this? > > Use gmpy. > > >>> import gmpy > >>> help(gmpy.sqrt) > > Help on built-in

Re: integer square roots

2009-07-23 Thread Mensanator
On Jul 23, 6:02 pm, timro21 wrote: > I wish to process billions of 100-digit numbers and test if each has > an integer square root.  What's the most efficient way to do this? Use gmpy. >>> import gmpy >>> help(gmpy.sqrt) Help on built-in function sqrt in module gmpy: sqrt(...) sqrt(x): ret