None???

Gerrit Holl gerrit at nl.linux.org
Mon Sep 22 10:36:01 EDT 2003


David Eppstein wrote:
> In article <3F6D68AA.9070603 at aon.at>, Gregor Lingl <glingl at aon.at> 
> wrote:
> > This comes from using integer-constants together with
> > inputting integers, which causes the /-operator to
> > perform integer division.
> 
> Arguably, any code that uses / with integer arguments is now buggy, 
> because it will produce different results in different Python versions.  
> You should either use // (integer division) or force floating point 
> division (e.g. by changing the expression to income*percent/100.0).

Or, of course, use from __future__ import division. That is always
the first line of any of my files, I can't live without it :)

Gerrit.

-- 
208. If he was a freed man, he shall pay one-third of a mina.
        -- 1780 BC, Hammurabi, Code of Law
--
Asperger Syndroom - een persoonlijke benadering:
	http://people.nl.linux.org/~gerrit/
Het zijn tijden om je zelf met politiek te bemoeien:
	http://www.sp.nl/





More information about the Python-list mailing list