我需要得到平方根的上限,例如10**10001
(10^10001)。如果我做:
from math import sqrt
print(int(sqrt(10**10001))+1)
我看了一下,它给了我一个OverflowError
. 更准确地说,一个
Traceback (most recent call last)
File <stdin>, line 1, in <module>
OverflowError: int too large to convert to float.
我需要一个整数来回答。来自OverflowError
函数math.sqrt(x)
。如果有人可以提供帮助,将不胜感激。