[Edu-sig] Rational Division

Tim Peters tim_one@email.msn.com
Tue, 8 Feb 2000 01:42:31 -0500


[Jeffrey Kunce]
>>> So, what does "E" think? Does 2/3==0 or does 2/3==1
>>> or does 2/3=0.66..67 or does 2/3==2/3?

[Ka-Ping Yee]
>> In E, there are two operators for division:
>>    2 / 3  yields  0.666666
>>    2 _/ 3  yields  0

[Jeffrey Kunce]
> Leave it to me to try to be cute and wind up obscuring my point.
> Leave it to Ping to dig up a language called "E"
> I meant "Everyone" as in CP4*E*   :-)

Heh heh -- this is Nerd Comedy of Errors at its finest <wink>.

> Some people have been saying that "Everyone" thinks 2/3==0.6666
> Others say that 2/3 is obviously 0
> I was suggesting that perhaps "Everyone" thinks 2/3==2/3
> It should be tested, of course, by asking a subset of "Everyone"

I don't buy into this.  Python's closest predecessor (ABC) *was* designed to
be maximally unsurprising (via iterative user testing and redesign), and
ended up a self-contained universe, thoroughly isolating its users even from
their native filesystem ("too quirky").  Python tries to regularize the mess
that is the "real computing world", but doesn't try to deny or hide its
existence.  CP4E's goals seem much more in tune with that latter.

> But this is similar to the case-sensitive issue, and Guido has spoken.

Yes, and in harmony with Steve Morris's good suggestions, I'll just list the
alternatives and ask that followup rants be directed to comp.lang.python (or
me; I've played "corporate numeric apologist" for enough HW vendors that I
feel obliged to take this on as pennance ...):

1. 2/3 is 0.  Like C, Fortran and Python today.  Unlike real life outside
computer languages.

2. 2/3 is 0.666... but not exactly ("binary floating point").  Like Perl.
Vulnerable to excruciatingly subtle correctness surprises.

3. 2/3 is 2/3 ("rationals").  Like ABC (and what newbie testing there
determined *was* least surprising).  Also like DrScheme (but not all flavors
of Scheme).  Vulnerable to memory-use and timing surprises.

4. 2/3 is 0.666... but using decimal floating-point.  Like REXX, hand
calculators, and paper-and-pencil math.  Much in common with #2, but under
#2 0.1 is not exactly one tenth (you don't need testing to discover *that's*
confusing -- I've been explaining that one to frustrated newbies and
professionals(!) for 20-some years).

5. 2/3 is 2/3, and sin(asin(2/3)) is 2/3 exactly, and exp(log(2/3)) is 2/3
exactly, ... "the constructive reals".  I'm not aware of any general-purpose
language that offers these (they're slow, and e.g. testing for equality is
undecidable).

If anyone has another in mind, let me know!  I'll keep a list.

> I stand by my general point, though. Programmers don't have a clue
> about what "Everyone" thinks or needs. If we pretend we do, CP4E
> will have all the credibility of a Star Trek convention.

Well, if you want to teach someone how to cook, don't spend too much time
asking eaters what they imagine appropriate tools for the job may be <0.5
wink>.  They're going to have to learn about weights, measures, temperature,
time, portion management, and how to read the 10,000 cookbooks that already
exist.  You ask *cooks* how to cook -- eaters can tell you what tastes good,
but don't have a clue about what it takes to accomplish that (note that each
of the 5 above comes with its own set of major drawbacks, which simply
aren't obvious at first).

One way to "make learning easy" is to (as in the recent Dijkstra quote)
infantalize the subject matter.  If that's what CP4E becomes, why bother ...

computers-in-practice-are-harder-than-computers-in-theory-ly y'rs
    - tim