Csound Csound-dev Csound-tekno Search About

Re: Raising to the power?

Date1998-01-22 18:23
FromHans Mikelson
SubjectRe: Raising to the power?
There are the opcodes ipow, kpow and apow.

Date1998-01-22 21:19
FromPer Villez
SubjectRaising to the power?

	I am trying to raise a number to a power within Csound, (say 2 to
the power of .04) and as far as I can tell there is no quick arithmetical
operator to do this. The only operator I can find is exp(). Does anybody
have a quick fudge for doing this?




Date1998-01-22 21:27
FromErik Spjut
SubjectRe: Raising to the power?
At 9:19 PM +0000 1/22/98, Per Villez wrote:
>	I am trying to raise a number to a power within Csound, (say 2 to
>the power of .04) and as far as I can tell there is no quick arithmetical
>operator to do this. The only operator I can find is exp(). Does anybody
>have a quick fudge for doing this?

exp(0.04*log(2)) will do it. e.g. x^y = exp(y*log(x))

-------------------------------------------------------------------------------
Erik Spjut (rhymes with cute) - Acting Director,The Center for Design Education
and/or Associate Professor of Engineering
Harvey Mudd College, Claremont, CA 91711  USA
Erik_Spjut@hmc.edu      Ph & Voice mail (909) 607-3890      Fax (909) 621-8967


Date1998-01-22 21:53
FromPer Villez
SubjectRe: Raising to the power?
Thanks a million Eric. Per




>At 9:19 PM +0000 1/22/98, Per Villez wrote:
>>	I am trying to raise a number to a power within Csound, (say 2 to
>>the power of .04) and as far as I can tell there is no quick arithmetical
>>operator to do this. The only operator I can find is exp(). Does anybody
>>have a quick fudge for doing this?
>
>exp(0.04*log(2)) will do it. e.g. x^y = exp(y*log(x))
>
>-------------------------------------------------------------------------------
>Erik Spjut (rhymes with cute) - Acting Director,The Center for Design
>Education
>and/or Associate Professor of Engineering
>Harvey Mudd College, Claremont, CA 91711  USA
>Erik_Spjut@hmc.edu      Ph & Voice mail (909) 607-3890      Fax (909) 621-8967