Re: Raising to the power?
Date | 1998-01-22 18:23 |
From | Hans Mikelson |
Subject | Re: Raising to the power? |
There are the opcodes ipow, kpow and apow. |
Date | 1998-01-22 21:19 |
From | Per Villez |
Subject | Raising 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? |
Date | 1998-01-22 21:27 |
From | Erik Spjut |
Subject | Re: 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 |
Date | 1998-01-22 21:53 |
From | Per Villez |
Subject | Re: 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 |