
Page 1 of 1

[ 6 posts ] 

needed: exponential function with any a real (float) base
Author 
Message 
Ford Prefect
Guru
Joined: Sat Mar 01, 2008 12:52 pm Posts: 1030

needed: exponential function with any a real (float) base
hi to all,
I need an exponential function with any a real (floating point) base, similar to exp(x) with Euler's number (e) as a base,
but with any a real base and with any a real exponent, e.g.
1,5^x
2^x
e^x (=exp(x))
3^x
10^x
PI^e
I know, there should be a math formula to converse exp(x) to any other real (float) base, but school maths are long gone...
_________________ regards, HaWe aka Ford #define S sqrt(t+2*i*i)<2 #define F(a,b) for(a=0;a<b;++a) float x,y,r,i,s,j,t,n;task main(){F(y,64){F(x,99){r=i=t=0;s=x/332;j=y/321;F(n,50&S){t=r*ri*i;i=2*r*i+j;r=t+s;}if(S){PutPixel(x,y);}}}while(1)}

Tue Jul 29, 2008 6:00 pm 


zeron
Rookie
Joined: Wed Jul 23, 2008 12:48 am Posts: 19 Location: Germany

a^x = exp( x * log(a) )
with log being the natural logarithm
Last edited by zeron on Wed Jul 30, 2008 6:01 am, edited 1 time in total.

Wed Jul 30, 2008 3:43 am 


Ford Prefect
Guru
Joined: Sat Mar 01, 2008 12:52 pm Posts: 1030

uuuh...yeah.
looks familiar
thx a lot
_________________ regards, HaWe aka Ford #define S sqrt(t+2*i*i)<2 #define F(a,b) for(a=0;a<b;++a) float x,y,r,i,s,j,t,n;task main(){F(y,64){F(x,99){r=i=t=0;s=x/332;j=y/321;F(n,50&S){t=r*ri*i;i=2*r*i+j;r=t+s;}if(S){PutPixel(x,y);}}}while(1)}

Wed Jul 30, 2008 4:03 am 


erabenda
Rookie
Joined: Tue Aug 12, 2008 11:06 pm Posts: 2

Re: needed: exponential function with any a real (float) base
Does RobotC have an e^x function? Isn't exp(x) really 10^x in RobotC?

Tue Aug 12, 2008 11:09 pm 


Ford Prefect
Guru
Joined: Sat Mar 01, 2008 12:52 pm Posts: 1030

Re: needed: exponential function with any a real (float) base
shock: I never doubted that exp(x) = e^x ! (edit:) but as Dick Swan wrote and as I could check, exp(x) = e^x and log(x)=ln(x) as it was supposed to be.
_________________ regards, HaWe aka Ford #define S sqrt(t+2*i*i)<2 #define F(a,b) for(a=0;a<b;++a) float x,y,r,i,s,j,t,n;task main(){F(y,64){F(x,99){r=i=t=0;s=x/332;j=y/321;F(n,50&S){t=r*ri*i;i=2*r*i+j;r=t+s;}if(S){PutPixel(x,y);}}}while(1)}
Last edited by Ford Prefect on Wed Aug 13, 2008 9:26 am, edited 1 time in total.

Wed Aug 13, 2008 2:57 am 


erabenda
Rookie
Joined: Tue Aug 12, 2008 11:06 pm Posts: 2

Re: needed: exponential function with any a real (float) base
Thanks for the quick response! I thought I had read somewhere that the exp(x) was something other than e^x.

Wed Aug 13, 2008 9:26 am 



Page 1 of 1

[ 6 posts ] 

Who is online 
Users browsing this forum: No registered users and 1 guest 

You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot post attachments in this forum

