-1/2

Gary Herron gherron at islandtraining.com
Sun Jun 22 14:57:18 EDT 2008


Serve Lau wrote:
> What is the expected result of -1/2 in python?
>
> -- 
> http://mail.python.org/mailman/listinfo/python-list
 From the manual:


The result is always rounded towards minus infinity: 1/2 is 0, (-1)/2 is 
-1, 1/(-2) is -1, and (-1)/(-2) is 0.


Gary Herron




More information about the Python-list mailing list