Why is -1020450018 / 2091335377 = 0?


  • 1
    K

    Python gives -1 on my local machine.


  • 0
    K

    cpython always return the remainder and divisor with the same sign. in c++ it does not define it, but most compiler round divisor toward zero.


Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.