Toppling the numeric tower

Guido van Rossum guido at python.org
Thu Jul 26 17:26:26 EDT 2001


"Tim Hochberg" <tim.hochberg at ieee.org> writes:

> >>> 1e0 << 2e0
> 4 # exact
>   or
> 4e0 # inexact
> 
> Either answer sucks: the first turns two inexact operands into an exact
> result, while the second represents the results of bit twiddling, a discrete
> operation if ever there was one, as an inexact, floating point number. The
> best choice is to insist on exact numbers for integer operations.

Agreed.

> Note that I don't know that this is the meaning for isintegral meant by PEP
> 228, but it is the one that makes sense to me.

I don't know why PEP 228 doesn't reference Scheme.  It is clearly
inspired by Scheme.  See

http://www.swiss.ai.mit.edu/ftpdir/scheme-reports/r5rs-html/r5rs_8.html#SEC50

--Guido van Rossum (home page: http://www.python.org/~guido/)



More information about the Python-list mailing list