有意思,我在mac的term上试了试,发现报错
$ python3
Python 3.11.1 (v3.11.1:a7a450f84a, Dec 6 2022, 15:24:06) [Clang 13.0.0 (clang-1300.0.29.30)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> print(2**(10**10))
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ValueError: Exceeds the limit (4300) for integer string conversion; use sys.set_int_max_str_digits() to increase the limit
然后计算了数字的位数,得有3010299957
但是无法设置这么长的字符串
>>> sys.set_int_max_str_digits(3010299956)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
OverflowError: Python int too large to convert to C int
【 在 feng321 的大作中提到: 】
: 跑了一晚上,pycharm没有输出,也没有报错,是什么情况?再大一点,就报 MemoryError了。有大佬知道吗?是不是算出来了,但是pycharm的控制台没法输出啊?感觉内存占用也不大,才600m+
--
修改:littleSram FROM 8.219.207.*
FROM 8.219.207.*