[comp.lang.pascal] Power operator in C

E8D@PSUVM.BITNET (01/12/88)

In article <4736@pyr.gatech.EDU>, gus@pyr.gatech.EDU (gus Baird) says:
>
>Why's it good to not have "**" in Pascal?
>Well, most operators correspond to manipulations for which there
>are machine instructions in the computer under your high-level-language
>(HLL) machine.  I like for my students to understand that we're
>basically fooling ourselves when we pretend that our computers
>can raise numbers to powers without executing a rather intricate
>subroutine.
>
     Well you could have them write a function to duplicate ** even if
it was included in the language.  I thought the idea of a high level
language was so that the compiler did the intricate stuff and the
programmer could write clear readable code without a lot of effort.
     I don't see the point of limiting a language for teaching purposes.
Make the language useful and then teach the students to use it properly
-- or do you expect them to go learn a different language for the
"real world"?
     
      I like having a power operator because it helps make the equations
in my programs look like the equations I would write on paper.
      But anyway, we don't have it except as an extension in some versions
of Pascal so does anyone have a good power function for pascal?  I
understand there are some fast algorithms for raising numbers to integers.
Is it possible to use the same function for integer and real powers and
let the function decide how to treat them based on the variable type passed?
Isn't that what F***RAN does?
>--
>gus Baird
-------
Disclaimer: Sorry about the spelling.
     
  Evan Dresel
  Dept. of Geochemistry                             E8D @ PSUVM (bitnet)
  228 Deike Bldg.               ...!psuvax1!psuvm.bitnet!e8d (uucp <-->
  Penn State University                                 bitnet gateway)
  University Park, PA  16802        e8d%psuvm.bitnet@wiscvm.arpa  (arpa)
  (814) 863-0672