[issue10163] 7/200 and 7%200 show weird results

2010-10-21 Thread Georg Brandl
Georg Brandl added the comment: The bug title interestingly says "7%200", which does result in 7. I therefore think the OP just confused the order of operands for "%". -- resolution: -> invalid status: open -> closed ___ Python tracker

[issue10163] 7/200 and 7%200 show weird results

2010-10-21 Thread Mark Dickinson
Mark Dickinson added the comment: Seconding Eric's comment. This is what I get on my machine; can you cut and paste the equivalent output on yours (including whatever else is required to reproduce the results you describe) Python 2.6.1 (r261:67515, Feb 11 2010, 15:47:53) [GCC 4.2.1 (Apple

[issue10163] 7/200 and 7%200 show weird results

2010-10-21 Thread Eric Smith
Eric Smith added the comment: Which version of python? Could you run this from the command line and paste the complete session, including the version info that python prints on startup? -- nosy: +eric.smith, mark.dickinson ___ Python tracker

[issue10163] 7/200 and 7%200 show weird results

2010-10-21 Thread Georg Brandl
Georg Brandl added the comment: The result of 7 / 200 is easy to explain -- this is how integer division works in Python 2. (To get a floating result, one of the numbers must be a float.) 200 % 7 giving 7 however is strange. Are you sure this is what you calculated? -- nosy: +georg.

[issue10163] 7/200 and 7%200 show weird results

2010-10-21 Thread Henry Eshbaugh
New submission from Henry Eshbaugh : This may be happening with other numbers, but I got weird results with the modulus and division operators, after I imported the math module. I tried to do 7/200 and got 0, and 200%7 yielded 7, an impossibility with modulus. -- messages: 119274 nosy: