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,156
  • 7
  • 17
  • 31
Vishal Barvaliya
  • 153
  • 2
  • 12

1 Answers1

1

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

temp = a//10
print(temp)
Mureinik
  • 277,661
  • 50
  • 283
  • 320