Basic4ppc - Windows Mobile Development  

Go Back   Basic4ppc - Windows Mobile Development > Main Category > Questions & Help Needed
Home Register FAQ Members List Search Today's Posts Mark Forums Read

Questions & Help Needed Post any question regarding Basic4ppc.


Exp() function


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 06-05-2008, 06:52 PM
Junior Member
 
Join Date: Apr 2008
Location: FRANCE
Posts: 13
Default Exp() function

Hi there,

A simple question :-)

How to compute the exp() function in Basic4ppc ?
exp(1) = 2.718281828459045
exp(-1) = 0.36787944117144233

Many thanks,

Bruno.
Reply With Quote
  #2 (permalink)  
Old 06-05-2008, 07:02 PM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 1,756
Awards Showcase
Beta Tester Forum Contributer 
Total Awards: 2
Default

Like this
Quote:
Originally Posted by Bruno View Post
exp(1) = 2.718281828459045 = cE^1
exp(-1) = 0.36787944117144233 = 1/cE
Reply With Quote
  #3 (permalink)  
Old 06-05-2008, 07:10 PM
Junior Member
 
Join Date: Apr 2008
Location: FRANCE
Posts: 13
Default

Thanks Agraham, but ...

I have a formula with something like


result=exp(tmp)

tmp can be positive or negative.

How calculate result?

Bruno.
Reply With Quote
  #4 (permalink)  
Old 06-05-2008, 07:18 PM
Junior Member
 
Join Date: Apr 2008
Location: FRANCE
Posts: 13
Default

Is this ok
for:
result = exp(tmp)

in Basic4PPC
result = cE^(tmp)

Bruno.
Reply With Quote
  #5 (permalink)  
Old 06-05-2008, 07:21 PM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 1,756
Awards Showcase
Beta Tester Forum Contributer 
Total Awards: 2
Default

Quote:
Originally Posted by Bruno View Post
tmp can be positive or negative
Code:
Sub exp(num)
  If num < 0 Then
    Return 1/(cE^Abs(num))
  Else
    Return cE^num
  End If
End Sub
Reply With Quote
  #6 (permalink)  
Old 06-05-2008, 08:03 PM
Junior Member
 
Join Date: Apr 2008
Location: FRANCE
Posts: 13
Default

Thanks a lot Agraham.

Bruno.
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Function Key eillezcas Questions & Help Needed 0 08-27-2008 09:28 PM
Help with Math function go4saint Questions & Help Needed 2 03-31-2008 10:15 AM
Combinations function derez Share Your Creations 0 02-04-2008 12:40 PM
Round function klaus Questions & Help Needed 3 11-15-2007 12:42 PM
Filter function in sql. belotrei Questions & Help Needed 0 06-02-2007 02:17 PM


All times are GMT. The time now is 02:05 PM.


Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.1.0