python 中的 pow 函数用于非常大的数字

pow function in python for very large numbers

我正在尝试计算有序对 m,n 的因子使得 m*n | x-1。问题是 x 长 1.1 * 10^6 位,m 和 n 长 5*10^5 位。我想知道内置的 pow 是否会给我正确的答案。我无法检查 1000000 位数字的值,也无法在 python 中找到任何关于非常大数字的文档。 我的代码如下。

x=pow(2,3628800)
for n in factors:
    for m in factors:
        if x%(m*n)==1:
            ans+=1
        i+=1
        print(i)
print(ans)

是的,它会给你正确的输出。在 Python3 中,所有整数在大小方面基本上都是无限的。