Exp() function

Discussion in 'Questions (Windows Mobile)' started by Bruno, Jun 5, 2008.

  1. Bruno

    Bruno Member Licensed User

    Hi there,

    A simple question :)

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

    Many thanks,

    Bruno.
     
  2. agraham

    agraham Expert Licensed User

    Like this
     
  3. Bruno

    Bruno Member Licensed User

    Thanks Agraham, but ...

    I have a formula with something like


    result=exp(tmp)

    tmp can be positive or negative.

    How calculate result?

    Bruno.
     
  4. Bruno

    Bruno Member Licensed User

    Is this ok
    for:
    result = exp(tmp)

    in Basic4PPC
    result = cE^(tmp)

    Bruno.
     
  5. agraham

    agraham Expert Licensed User

    Code:
    Sub exp(num)
      
    If num < 0 Then
        
    Return 1/(cE^Abs(num))
      
    Else
        
    Return cE^num
      
    End If
    End Sub
     
  6. Bruno

    Bruno Member Licensed User

    Thanks a lot Agraham.

    Bruno.
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice