[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to detect EOFs in SEQ-files using M/C?



On Sun., 08-Sep-2002, at 05:00pm PDT (-0700 GMT), "Matthew Montchalin"
posted (off-topic) in "Comp.Sys.CBM":

 >> PI isn't a variable. It is a keyword, albeit an unusual one, complete
 >> with its own token. I believe it acts as a function with a fixed value.

 > Hmmmm. How is pi represented on the Apple II?

I wouldn't know, Friend. This is the "Comp.Sys.CBM" newsgroup -- it has
nothing at all to do with the Apple (which, just to refresh your memory,
was a COMPETITOR to Commodore computers!).

Speaking whereof, I have trimmed the follow-up line so that this thread
will hereafter propagate only on comp.sys.apple2, since it apparently has
NO relevance to Commodore computers...


 > Surely they don't use a whole token just for PI?

I'm not at all sure that you understand *either* PI, or BASIC tokens.

1. A BASIC token is simply a special byte that represents a keyword in the
   BASIC language. For example, byte 128 (decimal) is the END token. The
   keyword RESTORE, on the other hand, is represented by byte 140 (again
   in decimal). This is a marvelous way of squeezing the seven bytes of
   the word "RESTORE" into only one byte; and in fact, that's exactly what
   the system of tokens is designed to do. Without tokens, BASIC programs
   would be MUCH larger than they are.

2. PI is a transcendental irrational number of infinite length. It starts
   out 3.141592679... and extends on into infinity. There cannot be an
   EXACT representation of PI, just an approximation; but on the Commodore
   computer that representation is nine digits long (if my memory does not
   completely deceive me, 11 digits internally).

Since PI is frequently uses and would otherwise take up a lot of space,
Commodore, in a perfectly reasonable move, assigned it to a one-byte token.
That way, instead of saying 100 x=3.14159267, the programmer can save nine
bytes and write 100 x=[pi character] instead.

What's so strange about that???

--
----------------------------------------------------------------------------
                ***** "Glenn P.," <C128User@FVI.Net> *****
----------------------------------------------------------------------------
     Maybe it was the mention of the rats that did it. Because if Roger had
thought twice, he'd have gone quietly to the dungeon and bided his time,
and let the story go on from there, and the ending might have been very
different. There might have been a fair jailer's daughter to set him free,
or there might have been a secret passage from the dungeon, or the rats
might have proved friendly, and nibbled his bonds instead of him.
     But which of these fascinating things would have happened will never be
known, for Roger didn't think twice. He lost his temper instead, which is a
dangerous thing to lose when you are in the middle of a magic adventure...
----------------------------------------------------------------------------
              --= EAGER, Edward: "Knight's Castle" (1956) =--
----------------------------------------------------------------------------