Nasty typo in PEP 238 (revised)

David Eppstein eppstein at ics.uci.edu
Fri Jul 27 14:42:54 EDT 2001


In article <yu99n15qdzs7.fsf at europa.research.att.com>,
 Andrew Koenig <ark at research.att.com> wrote:

> >> A. Use x*1.0/y for true division, divmod(x, y)[0] for int
> >> division.  Especially the latter is best hidden inside a
> >> function.  You may also write floor(x)/y for true division if
> >> you are sure that you don't expect complex numbers.
> 
> David> Shouldn't this be float(x)/y ?
> 
> What if x is complex?

Did you read the last line?
-- 
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