-1

I am currently working on python 2.7. I observed that if we have : -10//6 the answer is -2 while 10//6 yields 1 Can i know why is there the difference?

Shasha
  • 1

1 Answers1

0

// performs the floor operation.

  • 10/6 is 1.666, the floor of which is 1
  • -10/6 is -1.666, the floor of which is -2
coredump
  • 37,664
  • 5
  • 43
  • 77