In python 3 you have to use integer division //
explicitly or else float division will apply even between 2 integers.
That's one of the major changes between python 2 and python 3
In your example: (will work both in python 2 and python 3 so it's backwards compatible!)
204221389795918291262976//10000
20422138979591829126
(you don't even need to convert to int
here, result is int
since both terms are int
)
BTW if you want to make this bug work with python 2 it is also possible :)
from __future__ import division
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…