python 大数除法自动封顶

python division with large numbers automatically ceiled

Python 3.7.4 (tags/v3.7.4:e09359112e, Jul  8 2019, 19:29:22) [MSC v.1916 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> print(111111111111111111/10)
1.1111111111111112e+16
>>> print(int(111111111111111111/10))
11111111111111112
>>>

参考上面的代码片段,有人可以帮我理解为什么 111111111111111111/10 returns 11111111111111112 而不是 11111111111111111 吗?

使用floor division:

>>> 111111111111111111//10
11111111111111111
>>>