simple math question

John Salerno johnjsal at NOSPAMgmail.com
Sat Feb 11 16:43:33 EST 2006


John Salerno wrote:
> Hi all. I'm just starting out with Python, so I'm a little slow right 
> now. :)
> 
> Can someone explain to me why the expression 5 / -2 evaluates to -3, 
> especially considering that -2 * -3 evaluates to 6?
> 
> I'm sure it has something to do with the negative number and the current 
> way that the / operator is implemented, but why doesn't it evaluate to 
> -2 instead?

Thanks for the help guys! It's clearer to me now, and I think I was just 
conceptualizing it the wrong way in the first place.



More information about the Python-list mailing list