0

if I use integer type cast conversion technique then it doesn't work for large numbers like 12630717197566440063

I got wrong answer in some cases like below in python 3

a =12630717197566440063;
print(a)
temp = a/10
print(int(temp))

Then I am getting 1263071719756644096 as a answer instead of 1263071719756644006

10 Rep
  • 2,217
  • 7
  • 19
  • 33
Vishal Barvaliya
  • 197
  • 1
  • 3
  • 14

1 Answers1

1

You can use the // (floor division) operator:

temp = a//10
print(temp)
Mureinik
  • 297,002
  • 52
  • 306
  • 350