View unanswered posts | View active topics It is currently Sat Apr 19, 2014 3:56 am






Reply to topic  [ 6 posts ] 
needed: exponential function with any a real (float) base 
Author Message
Guru
User avatar

Joined: Sat Mar 01, 2008 12:52 pm
Posts: 1030
Post 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/33-2;j=y/32-1;F(n,50&S){t=r*r-i*i;i=2*r*i+j;r=t+s;}if(S){PutPixel(x,y);}}}while(1)}


Tue Jul 29, 2008 6:00 pm
Profile
Rookie

Joined: Wed Jul 23, 2008 12:48 am
Posts: 19
Location: Germany
Post 
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
Profile
Guru
User avatar

Joined: Sat Mar 01, 2008 12:52 pm
Posts: 1030
Post 
uuuh...yeah.
looks familiar :oops:

thx a lot 8)

_________________
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/33-2;j=y/32-1;F(n,50&S){t=r*r-i*i;i=2*r*i+j;r=t+s;}if(S){PutPixel(x,y);}}}while(1)}


Wed Jul 30, 2008 4:03 am
Profile
Rookie

Joined: Tue Aug 12, 2008 11:06 pm
Posts: 2
Post 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
Profile
Guru
User avatar

Joined: Sat Mar 01, 2008 12:52 pm
Posts: 1030
Post Re: needed: exponential function with any a real (float) base
erabenda wrote:
Does RobotC have an e^x function? Isn't exp(x) really 10^x in RobotC?

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/33-2;j=y/32-1;F(n,50&S){t=r*r-i*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
Profile
Rookie

Joined: Tue Aug 12, 2008 11:06 pm
Posts: 2
Post 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
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 6 posts ] 

Who is online

Users browsing this forum: No registered users and 2 guests


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

Search for:
Jump to:  



Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.