PEP238 and zope
David Eppstein
eppstein at ics.uci.edu
Tue Jul 24 19:11:45 EDT 2001
In article <mailman.996013122.28143.python-list at python.org>,
barry at zope.com (Barry A. Warsaw) wrote:
> >>> must_be_int = 1 / 2
> >>> must_be_int
> 0
> >>> must_be_int = int(1.0 / 2.0)
> >>> must_be_int
> 0
And this addresses the problem of long->float inaccuracies how?
Seems like must_be_int = divmod(1,2)[0] is safer (if way uglier).
--
David Eppstein UC Irvine Dept. of Information & Computer Science
eppstein at ics.uci.edu http://www.ics.uci.edu/~eppstein/
More information about the Python-list
mailing list