Re: Question about function failing with large number

2013-08-13 Thread Chris Angelico
On Tue, Aug 13, 2013 at 4:33 PM, MRAB wrote: > Here's a way to calculate the integer square root: Yes, but the actual value of the square root isn't needed. All that's needed is to stop the loop once the sqrt is reached. ChrisA -- http://mail.python.org/mailman/listinfo/python-list

Re: Question about function failing with large number

2013-08-13 Thread MRAB
On 13/08/2013 13:42, Chris Angelico wrote: On Tue, Aug 13, 2013 at 1:12 PM, Anthony Papillion wrote: So I'm using the function below to test a large (617 digit) number for primality. For some reason, when I execute the code, I get an error telling me: OverflowError: long int too large to conve

Re: Question about function failing with large number

2013-08-13 Thread Dave Angel
Anthony Papillion wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA512 > > So I'm using the function below to test a large (617 digit) number for > primality. For some reason, when I execute the code, I get an error > telling me: > > OverflowError: long int too large to convert to float In

Re: Question about function failing with large number

2013-08-13 Thread Chris Angelico
On Tue, Aug 13, 2013 at 1:12 PM, Anthony Papillion wrote: > So I'm using the function below to test a large (617 digit) number for > primality. For some reason, when I execute the code, I get an error > telling me: > > OverflowError: long int too large to convert to float > > The error is being th

Question about function failing with large number

2013-08-13 Thread Anthony Papillion
-BEGIN PGP SIGNED MESSAGE- Hash: SHA512 So I'm using the function below to test a large (617 digit) number for primality. For some reason, when I execute the code, I get an error telling me: OverflowError: long int too large to convert to float The error is being thrown on this line: fo