[issue19574] Negative integer division error

2013-11-13 Thread Mark Dickinson
Mark Dickinson added the comment: See also http://docs.python.org/2/faq/programming.html#why-does-22-10-return-3 BTW, integer division does not use float division internally. That would fail for integers too large to be exactly representable as floats. The implementation can be seen in Objec

[issue19574] Negative integer division error

2013-11-13 Thread R. David Murray
R. David Murray added the comment: This is not an aspect of Python that can possibly change, I'm afraid, for backward compatibility reasons. -- nosy: +r.david.murray resolution: -> duplicate stage: -> committed/rejected status: open -> closed superseder: -> Integer division for negat

[issue19574] Negative integer division error

2013-11-13 Thread Vatroslav Suton
New submission from Vatroslav Suton: integer division obviously uses float division with math.floor, which produces invalid result when result is less than 0, simply try the following 5/2 versus -5/2. Please use math.ceil function for results less than 0. btw is there any way to patch that in _