Results 1 to 5 of 5

Thread: [2.0] what is equivalent to an Exponential function in C#

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Oct 2003
    Posts
    436

    [2.0] what is equivalent to an Exponential function in C#

    I have an expression to calculate and I am confused between Math.Pow() or Math.Exp().

    Expression to be calculated:

    1-(1-CPR)^(1/12)
    where ^ is exponential (works in excel).
    thanks
    nath

  2. #2
    Raging swede Atheist's Avatar
    Join Date
    Aug 2005
    Location
    Sweden
    Posts
    8,018

    Re: [2.0] what is equivalent to an Exponential function in C#

    You'd use Math.Pow() for that.

    C# Code:
    1. Math.Pow(1 - (1 - CPR), (1 / 12))
    Rate posts that helped you. I do not reply to PM's with coding questions.
    How to Get Your Questions Answered
    Current project: tunaOS
    Me on.. BitBucket, Google Code, Github (pretty empty)

  3. #3
    Banned timeshifter's Avatar
    Join Date
    Mar 2004
    Location
    at my desk
    Posts
    2,465

    Re: [2.0] what is equivalent to an Exponential function in C#

    You're welcome for pointing you to this thread...

    Oh, and thanks. I was curious about this too.

  4. #4
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: [2.0] what is equivalent to an Exponential function in C#

    The MSDN documentation says:

    Math.Pow: Returns a specified number raised to the specified power.

    Math.Exp: Returns e raised to the specified power.

    The only reason you would be confused is if you didn't read the documentation.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  5. #5
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: [2.0] what is equivalent to an Exponential function in C#

    The documentation for the Math.Exp method even says:
    Quote Originally Posted by MSDN
    Use the Pow method to calculate powers of other bases.

    Exp is the inverse of Log.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width