关于Python中大数模数的问题

问题描述 投票:3回答:1

我使用了Fermat的Little Theorem,发现40 ^ 65%7 = 3.但是当我在Python中使用以下代码时,它打印的答案是2.0:

print((math.pow(40,65) % 7))

为什么Python将结果错误地指定为2.0?

谢谢

python python-3.x number-theory
1个回答
© www.soinside.com 2019 - 2024. All rights reserved.