Generating e^x in Visual Basic .NET - McLaurance Series?

  • Thread starter Thread starter mtanti
  • Start date Start date
  • Tags Tags
    Exponential
Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
2 replies · 2K views
mtanti
Messages
172
Reaction score
0
Hello fellow programmers,
I need to generate a very long number for e^x. On the order of thousands of digits. How do I do that in Visual Basic .NET?

Is there some other more precise way to do it rather than McLaurance Series?

Marc
 
Physics news on Phys.org
Extended / arbitrary precision math can get really tricky as some pretty clever algorithms have been developed. Here is one example with source and documentation: http://www.apfloat.org, but it's a C++ program (also Java).

If you do a web search for programs to calculate pi, you'll find a lot of hits for programs / libraries that do this type of stuff.

What you didn't mention when calculating e^x, is if x is also an extended precision number (thousands of digits), or is it an integer?
 
x can be very long but it isn't necessary. Can be on the order of a 12 digit number...