-1/2

Terry Reedy tjreedy at udel.edu
Mon Jun 23 08:19:55 CEST 2008



Serve Lau wrote:
> What is the expected result of -1/2 in python?

Python 3.0b1 (r30b1:64403M, Jun 19 2008, 14:56:09) [MSC v.1500 32 bit 
(Intel)]
n win32
Type "help", "copyright", "credits" or "license" for more information.
 >>> -1/2
-0.5
as expected ;-)

-1//2 is as Gary Herron specified from the manual, for reasons posted 
here several times and which should be in the FAQ




More information about the Python-list mailing list