On Sat, Jun 05, 2004 at 07:03:03PM +0900, Mark Sparshatt wrote:
> Michael Neumann wrote:
> 
> >>This is one area where (IMHO) Python took the right choice.  (I can't 
> >>believe I said that).
> >>   
> >>
> >
> >Well, I believed that's how Python works as well. But in Python (2.3):
> >
> > >>> 1 / 2
> > 0
> >
> > >>> 1 // 2
> > 0
> >
> > >>> 1.0 // 2
> > 0.0
> >
> > >>> 1.0 / 2
> > 0.5
> >
> > >>> 1 / 2.0
> > 0.5
> >
> >So they have the same "problem" as we in Ruby. But AFAIK, they can
> >better control the impacts than Ruby can (limited to module scope?).
> > 
> >
> However GvR has decided to fix the problem in the way you suggest, by 
> making // mean integer division and for / to mean float division.
> 
> Try this
> 
> >>> 1/2
> 0
> >>> from __future__ import division
> >>> 1/2
> 0.5
> >>> 1//2
> 0
> 
> That's using version 2.3.3

Ah thanks.... would be great to see this in Ruby too (without breaking
existing code).

Regards,

  Michael