[issue19446] Integer division for negative numbers

2013-11-14 Thread Mark Dickinson
Mark Dickinson added the comment: Nitin: > Is there any operator for integer division in python? Yes, there is: the '//' operator. :-) There's no universally agreed upon definition for 'integer division' when negative numbers enter the mix, but I'm guessing that in this case you need someth

[issue19446] Integer division for negative numbers

2013-10-30 Thread Nitin Kumar
Nitin Kumar added the comment: Hi Georg, Is there any operator for integer division in python? On Wed, Oct 30, 2013 at 1:00 PM, Georg Brandl wrote: > > Georg Brandl added the comment: > > Hi Nitin, > > "a // b" is defined as the floor division operation, same as what > "math.floor(a / b)" giv

[issue19446] Integer division for negative numbers

2013-10-30 Thread Georg Brandl
Georg Brandl added the comment: Hi Nitin, "a // b" is defined as the floor division operation, same as what "math.floor(a / b)" gives: the largest integer <= a / b. -7/2 is -3.5, the largest integer <= -3.5 is -4. -- nosy: +georg.brandl resolution: -> invalid status: open -> closed

[issue19446] Integer division for negative numbers

2013-10-30 Thread Nitin Kumar
Changes by Nitin Kumar : Added file: http://bugs.python.org/file32421/Integer_division.py ___ Python tracker ___ ___ Python-bugs-list mailing

[issue19446] Integer division for negative numbers

2013-10-30 Thread Nitin Kumar
Changes by Nitin Kumar : Removed file: http://bugs.python.org/file32420/Integer_division.py ___ Python tracker ___ ___ Python-bugs-list mailin

[issue19446] Integer division for negative numbers

2013-10-30 Thread Nitin Kumar
New submission from Nitin Kumar: Mathematically python is not giving correct output for integer division for negative number, e.g. : -7//2= -3 but python is giving output -4. -- components: IDLE files: Integer_division.py messages: 201715 nosy: Nitin.Kumar priority: normal severity: no