print longs

Tim Peters tim_one at email.msn.com
Wed Oct 6 01:02:58 EDT 1999


[Tim]
> ...
> These "different rules for different numbers", like tagging long
> ints with "L", don't make much sense to people.

[William "Billy" Tanksley]
> I'd like that too.  Only keep floats out of it if possible -- Lisp had
> the right idea there.  I think 1/2 should return 1/2 unless otherwise
> coerced.
>
> ABC worked that way, IIRC.

Yes, and that's why Python doesn't <0.1 wink>.  A simple numeric loop that
doubles its storage and processing requirements on each iteration is a
common outcome of using unbounded rationals under the covers.  That's not
user-friendly either; rationals are as much a tool for experts as
floating-point *should* be, but for different reasons.

The only scheme I've seen that "real people" pick up at once is REXX's --
because Cowlishaw deliberately implemented an arithmetic that mimics what
people do with pencil and paper (fixed-but-unbounded precision decimal
floating point, with a massive exponent range).  In a lucky break, despite
that people no longer know how to use pencils, much the same scheme is used
in pocket calculators.

I think Python2 is going to need a lot of ways to spell numeric literals
<wink>.

> 'bots have sisters?

Humanist.

all-god's-children-have-sisters-ly y'rs  - tim






More information about the Python-list mailing list