Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!cs.utexas.edu!sm.unisys.com!ucla-cs!math.ucla.edu!tony From: tony@joshua.math.ucla.edu Newsgroups: comp.lang.c Subject: The pow() function... Message-ID: <404@sunset.MATH.UCLA.EDU> Date: 1 Feb 89 21:58:03 GMT Sender: news@MATH.UCLA.EDU Reply-To: tony@MATH.UCLA.EDU () Distribution: na Organization: UCLA Mathematics Department Lines: 36 Thank you netland for all of the replies regarding my question about the pow() function. I received a lot fo replies regarding how inefficient the pow() function was for flipping signs back and forth. I realize that this is true but the only reason I wanted to do this was because of the following: I am taking the n derivatives of a vector of cos functions S [w] = [1, cos (w), cos (2w), ... , cos (nw)] S [w] d/dw = [0, -sin (w), -2 sin (2w), ... , -n sin (nw)] . . . . . . . . . . . . . . . S [w] d^m/dw^m = [0, -sin (w), -2^m sin (2w), ... , -n^m sin (nw)] The closed for solution being : (-1)^m * (n^m) * cos (nm - mPI/2) Since I am still testing my program I wanted to use something that I (and my non-programming engineering friend) can see right off as being the closed form solution. I therefore apologize for mis-using the word elegant (I seemed to have offended a few people) and I also apologize for posting a simplistic example (Please no more personal attacks!). I promise all of you people who replied that I will stop using the pow () as soon as everything is debugged (and to optimize the heck out of the program)! Thanks again for replying in the first place. Tony