Division between two integers should truncate toward zero.
Answers
Answered by
0
Do floating point division then convert to an int. No extra modules needed.
>>> int(float(-1)/2) 0 >>> int(float(-3)/2) -1 >>> int(float(1)/2) 0 >>> int(float(3)/2)Similar questions