floating point division -- question

William Park opengeometry at yahoo.ca
Wed Nov 27 13:06:09 EST 2002


Gerhard H?ring <gerhard.haering at opus-gmbh.net> wrote:
> William Park <opengeometry at yahoo.ca> wrote:
>> Some time ago, there was thread discussing adding a floating point division
>> operator, like //.  Doing 'a//b' is certainly easier than doing 'a/float(b)',
>> and it doesn't break any existing codes.  Has there been any interest from
>> the Gods of Python?
> 
> Python 2.2.2 (#37, Oct 14 2002, 17:02:34) [MSC 32 bit (Intel)] on win32
> Type "help", "copyright", "credits" or "license" for more information.
>>>> from __future__ import division
>>>> 3 / 5
> 0.59999999999999998
>>>> 3 // 5
> 0
> 
> It's been there since the original Python 2.2 release. See
> http://www.python.org/doc/current/whatsnew/node7.html for details.

Thanks Gerhard.  Although I would've have switched the two operator, so
that existing code doesn't change...

-- 
William Park, Open Geometry Consulting, <opengeometry at yahoo.ca>
Linux solution for data management and processing. 



More information about the Python-list mailing list