【发布时间】:2018-05-30 23:30:46
【问题描述】:
我想在 Python 中计算大于 10^2000 的数字的平方根。如果我把这个数字当作一个普通的整数,我总会得到这个结果:
Traceback (most recent call last):
File "...", line 3, in <module>
print( q*(0.5) )
OverflowError: int too large to convert to float
我该如何解决这个问题?或者是否存在使用 Python 以外的其他方法来计算这个平方根?
【问题讨论】:
-
你的意思是
10^2000还是10**2000?
标签: python python-3.x large-data largenumber square-root