Why in Python the remainder of dividing 45 by 60 is 45?

45 % 60 = 45 
  • 3
    How else? This is the usual definition of the remainder. n = q * d + rem and 0 ≤ rem < |d| - MBo
  • 3
    When divided with the remainder, the remainder should always be less than the divisor. - LFC
  • 3
    45 is divisible by 60. Cheloe is 0, and the remainder is 45 (45 / 60s or 9 / 12th or 3 / 4th or 0.75x :)) - Michael Vaysman
  • And how much do you expect? - Enikeyshchik
  • @VladSpirin: 45 % -60 == -15 and -15 > -60 - jfs

1 answer 1

Because the closest integer that can be completely (without remainder) divided by 60 is 0. Accordingly, the remainder from division is 45.