Using the sqrt function of math module for long numbers in python
问题 I was working with numbers of 200 digits in python. When finding the square root of a number using math.sqrt(n) I am getting a wrong answer. In[1]: n=9999999999999999999999999999999999999999999999999999999999999999999999 999999999999999999999999998292000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000726067 In[2]: x=int(math.sqrt(n)) In[3]: x Out[1]: 10000000000000000159028911097599180468360808563945281389781327