# to the nth power
Randy Hutson
randy at cs.tamu.edu
Fri Nov 2 05:28:44 AEST 1990
In article <15984 at mentor.cc.purdue.edu-> edgincd2 at mentor.cc.purdue.edu (Chris Edgington *Computer Science Major*) writes:
->In article <90305.005050CJH101 at psuvm.psu.edu->, CJH101 at psuvm.psu.edu (Carl J. Hixon) writes:
->-> I appologize for bothering you computer wizards with such an elementary
->-> question but, I'm floundering. Why am I unable to find an opperator which
->-> raises a number to a power. (The fortran equivalent of x**n) Is there such
->
->I don't know if this is what you are looking for, but this is a neat little
->trick to take a number to a power.
->
-> Answer = exp(ln(Root)*Exponent);
->
->Chris Edgington
I use an even neater trick!
Answer = pow(Root, Exponent);
More information about the Comp.lang.c
mailing list