Re: exponentiation operator (lack of)



> The FAQ points out a perfectly valid reason for omitting any sort
> of exponentiation operator. C is not alone among languages in
> doing this. Exponentiation is not the most prevalent of operators,
> and is normally a subroutine in almost any language.

Historically that is not quite correct. My first language was
Fortran IV, used for my PhD thesis at UCB. In the 70s I briefly used
Burroughs Algol (a derivative of Algol 60-68) and Gnu Pascal in the
80s. The exponentiation operators were **, ^ and **, respectively.
Those 3 languages were widely used in their heyday although
of course were not useful for low-level system programming.

Algol 60 is supposed to have influenced C indirectly,
but the ^ operator was renamed. As I noted, the lack is presently
felt in low-level numerical applications of C. These are
growing rapidly, especially in parallel & multicore processing.

One reason: the ability of C to interact closely with the hardware
and do resource management. This is critical in supercomputers.

Second reason: the "feed" end of the Fortran pipeline is emptying.
Example: our College of Engineering has not taught Fortran to
undergraduates since 1997 (why? industry feedback). Numerical
methods are taught to freshmen in C for low-level components
and Matlab for high level scripts. One of our PhD students joined
Mathworks two yrs ago, and she works primarily in C.

Giving this ongoing enlargement in the scope of C applications,
I see no reason why a new operator (** or ^^) could not be
introduced to meet those needs either in a future standard, or
in a "successor to C" , as discussed in another thread.
It should have a high precedence, just under the dot.

.



Relevant Pages

  • Re: Case-insensitivity considered harmful
    ... are lots where it is very hard to distinguish many lower-case letters. ... fonts use a non-traditional '0' for that reason, ... In computer languages, ... common convention was commentary in mixed case and code in upper. ...
    (comp.arch)
  • Re: C# or VB.NET?
    ... i am a part-time/casual developer. ... VBScript, and now when I'm migrating to .NET, I obviously chose VB.NET. ... The reason, of course, is the .NET Framework... ... The reason that both languages are identical is because they both target the .NET Framework. ...
    (microsoft.public.dotnet.framework.aspnet)
  • =?iso-8859-1?q?Re:_What_does_G=F6dels_Incompleteness_mean_for_the_Working_Mathematician=3F?=
    ... > Axiomatic languages do not lead to contradiction unless we have reason ... > There is no reason to believe that either is the case in Peano ... > algorithm computes an arithmetical relation R, ... theorems, theorems about dimension). ...
    (sci.math)
  • Re: A question on Newtons Method
    ... > Jon Harrop wrote: ... >> archaic theoretical foundation, other languages aren't. ... >> forced to use old code, I see no reason to use Fortran. ... > repository there's every reason to join Fortran literacy club. ...
    (sci.math.num-analysis)
  • Re: Decimal Arithmetic
    ... seen PL/I and FORTRAN programmers try to use the "**" exponentiation operator in C and C++ with very strange results. ... and PL/I except that multiplication and division are different which produced strange results when a friend of mine tried to round an integer value using the same techniques he used in FORTRAN and PL/I. ... BASIC and some other languages get around that by doing everything in floating point, ...
    (comp.lang.pl1)