ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> activepython
activepython
Re: New // operator
by David Ascher other posts by this author
Apr 30 2002 6:04PM messages near this date
view in the new Beta List Site
RE: New // operator | Re: New // operator
Syver Enstad wrote:

> "Matthew Sherborne" <miracle@[...].nz> writes:
> 
> >So I now realize that it is not "Integer Division", it is "Division
> >with the
> >result rounded down".
> >
> 
> I think you want this instead:
> 
> round(5/2)
> 
> By the way whats wrong with 5/2 = 2 ?
> You have five tennisballs, split them on two persons. Surely they can't
> have more than two tennisballs each.
> 
Most people who aren't familiar with integer division expect 1/2 to 
yield 0.5, not 0.  This confusion is what motivated the work outlined in 
the PEP.  Further motivational details are available in the PEP.

--david ascher

_______________________________________________
ActivePython mailing list
ActivePython@[...].com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Other options: http://listserv.ActiveState.com/mailman/listinfo/ActivePython
Thread:
Matthew Sherborne
Syver Enstad
Eric Sloane
Kari Hoijarvi
David Ascher
Jeff Shannon
David Ascher

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved