A use for integer quotients

Terry Reedy tjreedy at home.com
Mon Jul 23 15:28:54 EDT 2001


"Just van Rossum" <just at letterror.com> wrote in message
news:3B5C3713.A5201C5A at letterror.com...
...

> I think you're terribly overreacting.

Given your subsequent explanation, yes.  What did not apply to you was
directed at others.  For a broader and more considered response, which
may also explain what this straw broke, see my reply today to Guido in
PEP0238 Lament.

> To put it more subtly: *I* would never use int arithmetic for this
sort of thing in Python.

I call this straightforward and unarguable.  If you had said that, I
would not have responded.

> Integer arithmetic like may be a lot more natural if you have a
> strong C background, and if not wasting cycles is a priority. To me
> (no strong math background, no computer science education) it simply
> looks like "showing off" to do a simple thing like this with ints.

Whereas it looks wierd to me, with my C and math background and
residual concern for cycles, to do a simple int calc like this with
floats.  Most number theory (the theory of counts and integers) is
done, or traditionally has been done, without reference to the
possible existence or reals (or floats).  From within this universe,
resorting to real arithmethic has sometimes been seen as a 'using a
crutch', to be avoided if at all possible, whereas you see avoiding
the crutch, when one is available, as 'showing off'.  Interesting
difference in perspective.

>But I'm sure you'll see an insult in that line, too.

Not at all.  You explained how things look different to you because of
our different backgrounds.  Consequently, we can learn something from
from each other and broaden our views.  This is quite different from
either of us dogmatically claiming that our narrow view is reality for
both.

Cheers,

Terry






More information about the Python-list mailing list