为什么python和python3会给出不同的算术结果?

时间:2016-07-28 06:36:00

标签: python python-3.x arithmetic-expressions

我正在研究排列,并在python和python3中遇到了这种差异。

PYTHON:

Python 2.7.11+ (default, Jun  2 2016, 19:34:15)
>>> x=2432902008176639999
>>> y=121645100408832000
>>> q=x/y
>>> q
19

现在 PYTHON3:

Python 3.4.4 (default, Apr 17 2016, 16:02:33)
>>> x=2432902008176639999
>>> y=121645100408832000
>>> q=x/y
>>> q
20.0

有人可以解释这个以及如何获得相同的结果吗?

0 个答案:

没有答案