[Python-bugs-list] [ python-Bugs-465527 ] sqrt on a long int returns invalid resul

noreply@sourceforge.net noreply@sourceforge.net
Thu, 27 Sep 2001 10:58:20 -0700


Bugs item #465527, was opened at 2001-09-26 23:54
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=465527&group_id=5470

Category: Python Library
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Edward Kandrot (arcanelord)
>Assigned to: Tim Peters (tim_one)
Summary: sqrt on a long int returns invalid resul

Initial Comment:
n = 
1881988129206079638386972394616504398071635633794173827
0076335642298885971523466548531906060650474304531738801
1303396716199692321205734031879550656996221305168759307
650257059L
x = long(math.sqrt(n))

the result of this is that x is off by many orders of 
magnitude.  There should be a sqrt function that 
returns a long integer result so that large integer 
math will work as expected.  I have written this 
function in python, one that would set x to be the 
integer part of a sqrt, but the hd it was on is 
currently damaged.  If this is determined to be an 
actual problem that needs to be fixed, I will submit 
the code in this bug (unless someone beats me to it).

----------------------------------------------------------------------

>Comment By: Guido van Rossum (gvanrossum)
Date: 2001-09-27 10:58

Message:
Logged In: YES 
user_id=6380

Which Python version? On which platform? In 2.1 and 2.2 I
get a decent result.

Assigning to Tim who usually answers these questions.

----------------------------------------------------------------------

You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=465527&group_id=5470