There is no need to call int() on a literal int: 1000003 is already an int, calling int() on it is just wasting time and making confusing code.
print (int(y1y2y3y4))
gives a NameError, since you don't have a variable "y1y2y3y4" defined. Please don't retype your example code from memory, make sure it works and then copy and paste code we can actually run.
I think we can simplify your example to this:
x = 1000112004278059472142857
y = 1000003
print(x/y)
print(int(x/y))
which correctly prints
1.0001090039510477e+18
1000109003951047619
as the division operator uses floating point division in Python 3. Use the floor-division operator // to duplicate the Python 2 behaviour for ints.
Closing this as not a bug. |