[comp.lang.misc] ^ considered mysterious

eric@snark.thyrsus.com (Eric S. Raymond) (01/01/91)

I'm trying to find a source for the use of ^ as an exponentiation operator
in on-line chat and flat-ASCII documents.

It has been suggested that the 3-1 USENET preference for ^ over FORTRAN
** is due to UNIX bc/dc, but the usage seems to predate UNIX (it was
evidently common on ITS, too).

It seems likely that both the bc/dc use and ITS use have a common root
in some notation or computer language, but I have no idea which one it
might be.  C, Pascal, Fortran, Ada, Basic, APL, COBOL, and LISP are all
right out, and I doubt it came from any assembler :-).

Has anyone got any idea about this?
-- 
      Eric S. Raymond = eric@snark.thyrsus.com  (mad mastermind of TMN-Netnews)

stt@inmet.inmet.com (01/02/91)

Algol 60, Basic, and many other languages have used the
circumflex, or up-arrow (as it used to print on some teletypes)
to indicate exponentiation.  It has the obvious superscript
connotation, and so is very natural.  The fact that circumflex
doesn't appear on 026 and 029 keypunches (if my memory
serves me) must have inhibited its use in the US for 
card-oriented languages like Fortran.  It also doesn't
appear on IBM 3270 terminals, which are essentially
glass-029s (:-o).

S. Tucker Taft
Intermetrics, Inc.
Cambridge, MA  02138

dak@sq.sq.com (David A Keldsen) (01/03/91)

stt@inmet.inmet.com writes:

[a far too lucid explanation, so I'll clutter it up a bit]

>Algol 60, Basic, and many other languages have used the
>circumflex, or up-arrow (as it used to print on some teletypes)
>to indicate exponentiation.  It has the obvious superscript
>connotation, and so is very natural.  

Algol 60 is very particular about this (see the "Report on the Algorithmic
Language Algol 60" CACM 6, 1, 1963 1-17.)

The "reference language" specifies an "up arrow" and the "publication
language" was supposed to use superscripts; as stt says, the
connotation is obvious and natural.  Implementors were permitted to use
other mappings; again, the circumflex was typical and and obvious
substitute for the up-arrow.  This falls under the "hardware
representations:"

	1. Each one of these is a condensation of the reference language 
	   enforced by the limited number of characters on standard input 
	   equipment.
	2. Each one of these uses the character set of a particular computer 
	   and is the language accepted by a translator for that computer.
	3. Each one of thesemust be accompanied by a special set of rules for 
	   transliterating from Publication or Reference language.
(from the Report, p. 3)

Other troublesome operators in Algol 60 include multiplication (who has
that big elementary-school X available?) subset-of, logical-and, logical-or,
not...

>The fact that circumflex
>doesn't appear on 026 and 029 keypunches (if my memory
>serves me) must have inhibited its use in the US for 
>card-oriented languages like Fortran.  It also doesn't
>appear on IBM 3270 terminals, which are essentially
>glass-029s (:-o).

In their favor, IBM did at least have a negation operator that looks just
like the one in the Algol 60 reference language.  Ah, well.  Nostalgia
isn't what it used to be...

Regards,
Dak
-- 
David A. 'Dak' Keldsen of SoftQuad, Inc. email: dak@sq.com  phone: 416-963-8337
"It's a poor sort of memory that only works backwards," the Queen remarked.
    -- _Through the Looking Glass & What Alice Found There_ by Lewis Carroll

ken@aiai.ed.ac.uk (Ken Johnson) (01/03/91)

In article <1Yz6Dw#3j256N9kwrs12ZPbSl0B78BO=eric@snark.thyrsus.com> eric@snark.thyrsus.com (Eric S. Raymond) writes:

>I'm trying to find a source for the use of ^ as an exponentiation operator

Every version of Basic that I knew in 1970 used it.  I think FOCAL did
too.  (Remember when...?)



-- 
Ken Johnson, AI Applications Institute,   ************************************
80 South Bridge, Edinburgh EH1 1HN        * Meat is Murder!                  *
E-mail ken@aiai.ed.ac.uk                  * Fish is justifiable ichthyocide! *
Phone 031-225 4464 extension 213          ************************************

abeals@autodesk.com (Only 355 more shopping days until Christmas) (01/05/91)

ken@aiai.ed.ac.uk (Ken Johnson) writes:

>In article <1Yz6Dw#3j256N9kwrs12ZPbSl0B78BO=eric@snark.thyrsus.com> eric@snark.thyrsus.com (Eric S. Raymond) writes:

>>I'm trying to find a source for the use of ^ as an exponentiation operator

>Every version of Basic that I knew in 1970 used it.  I think FOCAL did
>too.  (Remember when...?)


It's apparently musch older than that, in APL QutoeQuad, volume 20, #4
[July 1990], in a paper entitled "APL\?" by Hui, Iverson, McDonnell
and Whitney, they reference "De Morgan's use of ^ for power".

The reference given is:

Cajori, Floria, _A History of Mathematical Notations_, The Open
Court Publishing Co., 1928, Volume I, Paragraph 313.

--
Andrew Scott Beals
abeals@autodesk.com

sommar@enea.se (Erland Sommarskog) (01/12/91)

Also sprach David A Keldsen (dak@sq.sq.com):
>Other troublesome operators in Algol 60 include multiplication (who has
>that big elementary-school X available?)

Anyone with a terminal with a capability to display Latin-1
(ISO 8859/1) have this character at position 214. (Or is it
215?) I don't know if there is any Algol-60 compilers who
has taken advantage of this, though.
-- 
Erland Sommarskog - ENEA Data, Stockholm - sommar@enea.se
"There is only one success -- to be able to spend your life in your own way"
Christopher Morely